【发布时间】:2018-08-08 04:53:30
【问题描述】:
有一个v-select 组件,在更改时我正在启动fillData(selected),其中选择的是v-model。我需要在更改时更新datacollection.datasets.label 中的标签。我该怎么做?
<script>
import BarChart from './BarChart.js'
import { mapGetters, mapActions } from "vuex";
export default {
name : "TestLegPerformance",
components: {
BarChart
},
data: () => ({
datacollection : {
labels: ['Week-1','Week-2','Week-3'],
datasets: [
{
label: '',
backgroundColor: '#C58917',
data: [40, 50, 20]
}
]
},
selected: []
}),
computed: {
...mapGetters({
planNames: "planNames"
})
},
mounted () {
this.getAllPlanNamesAction();
},
methods: {
...mapActions(["getAllPlanNamesAction"]),
fillData(selected){
console.log(selected)
},
}
}
</script>
【问题讨论】:
标签: vue.js vuejs2 reactive vuetify.js vue-chartjs