[英]Vue - You may need an additional loader to handle the result of these loaders
[英]Vue Render HTML - You may need an additional loader to handle the result of these loaders
我正在嘗試在 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>
}
}
我通過安裝 babel 解決了這個問題
https://github.com/vuejs/babel-plugin-transform-vue-jsx
babel.config.js
module.exports = {
presets: [
'@vue/app'
]
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.