鍍金池/ 問答/網(wǎng)絡(luò)安全  HTML/ vue2.0使用handsontable總是報錯

vue2.0使用handsontable總是報錯

在vue的項目上通過npm安裝了handsontable,但是運行的時候,總是會報

**TypeError: rootElement.insertBefore is not a function**

嘗試過npm install @handsontable/vue 和 npm install handsontable
都一樣會報這個錯誤,表格也出不來。。

請問有什么解決方法么?

代碼如下:

<template>
<div>
      <div id="test-hot-t" class="wrapper">
      <htable :root="root" :settings="hotSettings"></htable>
    </div>
  </div>
</template>

<script>
import htable from 'handsontable';
export default {
  name: 'HelloWorld',
  el: "#test-hot-t",
  data () {
    return {
      root: 'test-hot',
        hotSettings: {
          data: [      
            ['20080101', 10, 11, 12, 13,true],
            ['20090101', 20, 11, 14, 13,true],
            ['20010101', 30, 15, 12, 13,true],
            ['20010101', 32, 213, 21, 312,true],
            ['20010201', 32, 213, 21, 312,true],
            ['20010301', 32, 213, 21, 312,true],
            ['20010401', 32, 213, 21, 312,true],
            ['20010501', 32, 213, 21, 312,true],
            ['20010601', 32, 213, 21, 312,true]
          ],
          colHeaders: true
        }
    }
  },
  components:{
    htable
  }
}
</script>
回答
編輯回答
墻頭草

您好,方便加好友嗎,最近也在使用handsontable,希望能和您交流。
按照官方配置不可以,請問您的環(huán)境怎么搭建的。謝謝

2018年2月19日 08:48
編輯回答
巴扎嘿

改為<script>引入就可以了

2018年2月25日 02:06