【发布时间】:2018-06-13 17:09:46
【问题描述】:
我正在尝试从 handsontable 中设置一个 vuejs 变量。
vuejs 变量:
this.dataChanged
在下面的代码块中无法通过手动设置获得,知道如何访问它吗?
<template>
<div id="hot-container">
<HotTable :root="root" :settings="hotSettings"></HotTable>
</div>
</template>
<script>
export default {
data() {
return {
#vuejs variable i want to set from hot
dataChanged: false,
root: 'test-hot',
hotSettings: {
data: [{something: 0}],
afterChange: function(changes, src) {
if (src !== 'loadData') {
this.dataChanged = true
}
},
methods: {
saveChanges: function () {
if (this.dataChanged){
//save data
}
}
}
【问题讨论】:
-
你有任何代码使用handsontable和上面的代码吗?
标签: vue.js handsontable