import Vue from'vue';import{ HotTable }from'@handsontable/vue';import{ registerAllModules }from'handsontable/registry';import{ createSpreadsheetData }from'./helpers';// register Handsontable's modulesregisterAllModules();newVue({el:'#example1',data:function(){return{hotSettings:{data:createSpreadsheetData(4,4),colHeaders:true,height:'auto',licenseKey:'non-commercial-and-evaluation'}}},methods:{swapHotData:function(){// The Handsontable instance is stored under the `hotInstance` property of the wrapper component.this.$refs.hotTableComponent.hotInstance.loadData([['new','data']]);}},components:{
HotTable
}});
<divid="example1"><hot-tableref="hotTableComponent":settings="hotSettings"></hot-table><br/><buttonv-on:click="swapHotData"class="controls">Load new data!</button></div>