thx / gogocode

GoGoCode is a transformer for JavaScript/Typescript/HTML based on AST but providing a more intuitive API.
MIT License
5.47k stars 417 forks source link

文件转换异常,规则:emitsOptions,文件:/Users/zhangsan/workspace/MCP_Vue3/src/commonModal/BillModal.vue Error: replace failed: export default {name: "BillModal" #228

Open sjkmuninj opened 1 year ago

sjkmuninj commented 1 year ago

transform in progress: [------------------------------------------------------------------------------------] 3/1250 文件转换异常,规则:emitsOptions,文件:/Users/zhangsan/workspace/MCP_Vue3/src/commonModal/BillModal.vue Error: replace failed: export default {name: "BillModal", components: {BkEmpty}, title: "这里是页面或组件名字", mixins:[commonMixin, searchMixin], props:{ fkCompId:{ type:String, required:true }, single:Boolean, options: { type:Object, default(){ return {}; } }, billType:{//1 卖卡 2 收银 type:Number, default(){ return null; }, validator: function(value) { if(value==null || value ==undefined){ return true; } return [1, 2].includes(value); } } }, data() { return { visibleModel:true, keyword:"", typeId:"", discountTypeId:"", cooperateId:"", empJoinFlag:0, fkMemberId:null, searchObj:{ empJoinFlag:0, keyword:"", typeId:"", discountTypeId:"", cooperateId:"", fkMemberId:null }, page:1, hasMore:true, onLoading:false, list:[], selectedRowId:undefined, selectedRow:undefined, selectedRows:[], selectedRowKeys:[], tableOption:{ indeterminate:false, checkAll:false }, columnObj: { code: {text: "单号", key: "billNo", col:1}, showCreateTime: {text: "单据日期", key: "showCreateTime", col:1}, showStatus: {text: "状态", key: "showStatus", col:1}, name: {text: "项目", key: "projects", col:3}, totalPrice: {text: "金额", key: "totalPrice", align:"right", col:1} } }; }, created() { }, mounted() { this.changeQueryComp(this.fkCompId); let{keyword="", fkMemberId} = this.options; if(!isEmptyStrict(keyword)){ this.searchObj.keyword = keyword; } if(!isEmptyStrict(fkMemberId)){ this.searchObj.fkMemberId = fkMemberId; } this.visibleModel = true; this.search(); }, methods: { /**

}, emits:['ok','hide'] } cannot be parsed! at /Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/node_modules/gogocode/src/js-core/core.js:283:31 at Array.forEach () at Object.replaceSelBySel (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/node_modules/gogocode/src/js-core/core.js:196:22) at AST.replace (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/node_modules/gogocode/src/Ast.js:421:19) at appendEmitsProp (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/utils/scriptUtils.js:140:19) at Object.module.exports [as rule] (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/src/emits-option.js:57:9) at /Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/index.js:42:28 at Array.reduce () at transform (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/index.js:37:37) at /Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/src/commands/transform.js:194:22