问题现象
项目引用了一个变量值,在启动页面时报错:
Method "defaultProps" has type "object" in the component definition. Did you reference the function correctly?
问题原因分析
如上图所示,将defaultProps放到了方法里面,导致总报上述错误。
解决办法
将defaultProps移出methods,与之并行即可。
代码样例
https://github.com/matevip/artemis/blob/master/src/views/system/role.vue