Answer the question
In order to leave comments, you need to log in
How to pass an array and not a Vue3 proxy?
setup() {
const beachData = ref([])
const data = ref([])
const dateDay = ref([])
const month = ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь']
const changedDay = computed(() => beachData.value)
console.log(changedDay.value)
onBeforeMount(() => {
axios.get('https://api.binance.com/api/v1/klines?symbol=LTCBTC&interval=1M&limit=12')
.then((res) => { // res.data = [213213, '12323', '32432432' ...]
data.value.push((res.data.map(item => item.filter((item, idx) => idx === 0))))
data.value[0].map((item) => {
let date = new Date(item[0])
beachData.value.push(month[date.getMonth()])
console.log(beachData.value)
})
})
})
return {
series: [{
name: "Desktops",
data: dateDay
}],
chartOptions: {
chart: {
height: 350,
type: 'line',
zoom: {
enabled: false
}
},
xaxis: {
categories: changedDay.value
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question