//定义装饰器函数 function info(target){ target.info='Person.info' }
//定义一个普通的类 @info class Person{}
console.log(Person.info)
2.2 执行npm run dev后的效果
1 2 3 4 5 6 7 8
ERROR in ./src/index.js 31:0
Module parse failed: Unexpected character '@' (31:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | | //定义一个普通的类 > @info | class Person{}