在vue项目引入表格插件 vue2-datatable-component
报错:
error in ./node_modules/vue2-datatable-component/src/index.vue
Syntax Error: Unexpected token (38:59)
36 | created () {
37 | // init query (make all the properties observable by using `$set`)
> 38 | const q = { limit: 10, offset: 0, sort: '', order: '', ...this.query }
| ^
39 | Object.keys(q).forEach(key => { this.$set(this.query, key, q[key]) })
40 | },
41 | watch: {
复制代码
解决办法:
在项目根目录,添加 .babelrc 文件
{
"presets": ["stage-2"]
}复制代码
完美解决~~
插件github : https://github.com/OneWayTech/vue2-datatable
所有评论(0)