1 回答

TA貢獻1995條經(jīng)驗 獲得超2個贊
您不能在它們之間引用數(shù)據(jù)屬性,而是可以使用計算屬性來處理您想要的內(nèi)容:
new Vue({
el: "#app",
created: function (){
this.newData()
},
data() {
return {
info: [],
}
},
computed:{
hotSettings(){
return {
data: this.info,
colHeaders: ['ID','Name',' pain'],
rowHeaders: true,
minRows: 2,
minCols: 3,
}
}
},
methods: {
newData() {
this.info = [
["a", "b", "c"],
["ra", "rb", "rc"]
]
// Handle Axios logic here
}
},
components: {
'hottable': Handsontable.vue.HotTable
}
});
<div id="app">
<HotTable :settings="hotSettings"></HotTable>
</div>
jsfiddle:https ://jsfiddle.net/hansfelix50/069s1x35/
添加回答
舉報