【问题标题】:Vue Render HTML - You may need an additional loader to handle the result of these loadersVue Render HTML - 你可能需要一个额外的加载器来处理这些加载器的结果
【发布时间】:2020-05-16 06:44:09
【问题描述】:

我正在尝试在 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>
       }
    }

【问题讨论】:

    标签: javascript vue.js vuejs2 vue-tables-2


    【解决方案1】:

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

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

    babel.config.js

        module.exports = {
         presets: [
          '@vue/app'
         ]
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-29
      • 1970-01-01
      • 2020-12-04
      • 2020-04-05
      • 1970-01-01
      • 1970-01-01
      • 2022-11-06
      • 2020-09-12
      相关资源
      最近更新 更多