2

我正在使用 gridjs-vue 包装器将 grid.js 与 Vue 一起使用。我想使用gridjs的格式化功能,但它需要html功能。如何将 html 函数导入到我的组件中?如果我尝试从 gridjs-vue 导入它,它会说在 gridjs-vue 中找不到 html。

4

1 回答 1

0

使用this.$gridjs.html(...). 例子:

this.cols = [
  {
    name: 'Model',
    formatter: cell => this.$gridjs.html(`<b>${cell}</b>`)
  },
  { ... },
  { ... }
]

https://github.com/grid-js/gridjs-vue#gridjshtml

于 2020-09-23T09:30:12.243 回答