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

【gogocode-plugin-vue插件】this.$delete转换错误 #164

Open
kaizige10 opened this issue Jun 28, 2022 · 0 comments
Open

【gogocode-plugin-vue插件】this.$delete转换错误 #164

kaizige10 opened this issue Jun 28, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@kaizige10
Copy link

kaizige10 commented Jun 28, 2022

  • version: [email protected]
  • 执行的命令是
    gogocode -s ./src-t gogocode-plugin-vue -o ./src -p exclude-rules=eventsApi
  • playground demo:
export default {
    beforeDestroy() {
        const names = Object.keys(this.diffMap);
        (names || []).forEach((name) => {
            const diffObj = this.diffMap[name];
            this.$delete(diffObj, 'leftVm');
            this.$delete(diffObj, 'rightVm');
            this.$delete(this.diffMap, name);
        });
    },
};
  • your description:
    将上述代码转换时,得到的结果是:
export default {
    beforeUnmount() {
        const names = Object.keys(this.diffMap);
        (names || []).forEach((name) => {
            const diffObj = this.diffMap[name];
            delete diffObj;
            delete diffObj;
            delete this.diffMap;
        });
    },
};

个人认为应该是少了key,delete diffObj;应该转为delete diffObj.leftVm;

@kaizige10 kaizige10 added the bug Something isn't working label Jun 28, 2022
@kaizige10 kaizige10 changed the title this.$delete转换错误 【gogocode-plugin-vue插件】this.$delete转换错误 Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant