HandsontableWithVue (一) 导入官方的汉化包

import { HotTable } from '@handsontable/vue';
import Handsontable from 'handsontable';

  导入handsontable

data: function() {
    return {
      hotSettings: {
        data: Handsontable.helper.createSpreadsheetData(6, 10),
        colHeaders: true
      }
    }
  },
  components: {
    HotTable
  }

  这是基础的vue handsontable data    然后注册组件

  import 'handsontable/languages/zh-CN'

  导入语言包

忘了,template 里

<hot-table :settings="hotSettings"></hot-table>

  上面这些都是我照搬的哈哈哈

使用语言包,只要添加一样设置就可以了

language: 'zh-CN', 在hotsettings 里添加这一样设置就可以汉化了。

handsontable的中文文档奇缺,还是看官方文档吧,不过英语不好的话,很吃力,比如我。

一点点来。总会搞定的。

原文地址:https://www.cnblogs.com/LiuShuang-GoJava/p/11382093.html