Unexpected token export
pasBone opened this issue · 5 comments
pasBone commented
export const Checkbox = require('./Checkbox')
Uncaught SyntaxError: Unexpected token export
我是直接安装然后 require('rctui') 就报这个错
Lobos commented
babel,webpack有没有配置?新项目的话,执行一下
node node_modules/rctui/cli/init.js all
codepandy commented
这个安装后也不能用啊,有没有个比较完整的使用教程啊
Lobos commented
安装完执行node devServer.js 会启动一个服务,可以看到一个demo的,按那个demo配置就可以了
也可以参考这个项目的配置,不过有点复杂,有后端的代码 https://github.com/Lobos/hydra
Lobos commented
加了一个编译过的文件,如果编译不了的话,使用这个文件吧
// html
<script src="https://unpkg.com/rctui/dist/index.js"></script>
// webpack config
externals: {'react': 'React', 'react-dom': 'ReactDOM', 'rctui': 'rctui'},
// jsx
import { Form } from 'rctui'
...