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

用creator v2.12 最新版打开label的demo,VMLabel如果带有template mode的,其对应Label组件中String值会被自动清空。 #4

Open
xuzhiping7 opened this issue Aug 5, 2019 · 4 comments

Comments

@xuzhiping7
Copy link

旧版本2.09没问题,麻烦看看是不是有什么兼容问题。

新建的label带templatemode的,重新打开场景或者编辑下代码刷新同样也会丢失。

@aiversonwk
Copy link

我也遇到这个问题

@aiversonwk
Copy link

看了下,是上次提交在label中假的if(!this.originText)return "";导致的

@xuzhiping7
Copy link
Author

xuzhiping7 commented Aug 6, 2019

我在vmlabel.ts加了个保护暂时解决这个问题,在编辑器模式下不让他去改动这个值

setLabelValue(value) {
if (CC_EDITOR) return;
this.getComponent(this.labelType).string = value + '';
}

@wsssheep
Copy link
Owner

VMLabel 中 CC_EDITOR 条件取反了:
start(){
if (CC_EDITOR) return; //修改此处
this.onValueInit();
}

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

3 participants