Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

事件API转换失败 #253

Open
laiyanzhang opened this issue Aug 9, 2024 · 0 comments
Open

事件API转换失败 #253

laiyanzhang opened this issue Aug 9, 2024 · 0 comments

Comments

@laiyanzhang
Copy link

laiyanzhang commented Aug 9, 2024

版本:0.2.28
描述:执行事件API转化时出现部分事件API没有成功转化的情况
步骤:
1、执行转化命令gogocode -s ./src/views/components/businessFlow/components/Edit.vue -t gogocode-plugin-vue -o ./src/views/components/businessFlow/components/Edit1.vue
2、报错

文件转换异常,规则:eventsApi,文件:F:\xuanwu\IdeCopy\src\views\components\businessFlow\components\Edit.vue Error: replace failed: $emit(Bus, `removeTab-${this.curTabParams.name}`
this.curTabParams.name) cannot be parsed!
    at Array.forEach (<anonymous>)
    at Object.replaceSelBySel (F:\nvm\v14.20.0\node_modules\gogocode-cli\node_modules\gogocode\src\js-core\core.js:196:22)
    at AST.replace (F:\nvm\v14.20.0\node_modules\gogocode-cli\node_modules\gogocode\src\Ast.js:421:19)
    at Object.module.exports [as rule] (F:\nvm\v14.20.0\node_modules\gogocode-plugin-vue\src\events-api.js:77:14)
    at F:\nvm\v14.20.0\node_modules\gogocode-plugin-vue\index.js:42:28
    at Array.reduce (<anonymous>)
    at transform (F:\nvm\v14.20.0\node_modules\gogocode-plugin-vue\index.js:37:37)
    at F:\nvm\v14.20.0\node_modules\gogocode-cli\src\commands\transform.js:194:22
    at Array.forEach (<anonymous>)

3、文件报错定位代码:Bus.$emit(`removeTab-${this.curTabParams.name}`, this.curTabParams.name)
预期:事件API的转化能全部转化成功
其他:除此之外大部分链式调用皆无法转化成功,比如Bus.$off(`removeTab-${curTabParams.name}`).$on()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant