[英]Vue Render HTML - You may need an additional loader to handle the result of these loaders
I'm trying to render HTML dynamically in Vue (javascript) and I'm getting this error, does anyone know how to fix it?我正在尝试在 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.
This is the code that generates the above error:这是产生上述错误的代码:
headings: {
id: 'ID',
selected: function (h) {
return <b-form-checkbox v-model={this.checkedAll} onChange={this.selectAll}>
</b-form-checkbox>
}
}
I solved the problem by installing babel我通过安装 babel 解决了这个问题
https://github.com/vuejs/babel-plugin-transform-vue-jsx https://github.com/vuejs/babel-plugin-transform-vue-jsx
babel.config.js babel.config.js
module.exports = {
presets: [
'@vue/app'
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.