Decorator 属于es7的语法糖 所以我们在项目中使用的时候要借助babel插件编译:
cnpm install babel-plugin-transform-decorators-legacy --save-dev
然后在 .babelrc 中进行配置
{
"plugins": ["transform-decorators-legacy"]
}
Decorator 属于es7的语法糖 所以我们在项目中使用的时候要借助babel插件编译:
cnpm install babel-plugin-transform-decorators-legacy --save-dev
然后在 .babelrc 中进行配置
{
"plugins": ["transform-decorators-legacy"]
}