项目开始
vue create .
# 默认配置
代码:
export default {
render(h) {
return (<div>11</div>);
}
}
尝试过的:
方案1
https://github.com/vuejs/jsx#...
Install the preset with:
npm install @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props
Then add the preset to.babelrc
:
{
"presets": \["@vue/babel-preset-jsx"\]
}
报错
Module parse failed: Unexpected token (62:12)
File was processed with these loaders:
* ./node_modules/eslint-loader/index.js
You may need an additional loader to handle the result of these loaders.
| },
| render(h) {
> return (<div>11</div>);
| }
方案二
https://github.com/vuejs/babe...
npm install babel-plugin-syntax-jsx babel-plugin-transform-vue-jsx babel-helper-vue-jsx-merge-props babel-preset-es2015 --save-dev
In your.babelrc
:
{
"presets": \["env"\],
"plugins": \["transform-vue-jsx"\]
}
报错 同上
方案三:
https://segmentfault.com/q/10... @zangeci 的问答
报错 同上