2

我正在尝试在 Vue (javascript) 中动态呈现 HTML,但出现此错误,有人知道如何解决吗?

Module parse failed: Unexpected token (224:36)
File was processed with these loaders:
 * ./node_modules/cache-loader/dist/cjs.js
 * ./node_modules/vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.

这是产生上述错误的代码:

    headings: {
       id: 'ID',
       selected: function (h) {
          return  <b-form-checkbox v-model={this.checkedAll} onChange={this.selectAll}>
                </b-form-checkbox>
       }
    }
4

1 回答 1

1

我通过安装 babel 解决了这个问题

https://github.com/vuejs/babel-plugin-transform-vue-jsx

babel.config.js

    module.exports = {
     presets: [
      '@vue/app'
     ]
    }
于 2020-01-30T16:22:29.297 回答