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

小程序开启增强编译后会有问题 #16

Open
yautah opened this issue Jun 28, 2019 · 5 comments
Open

小程序开启增强编译后会有问题 #16

yautah opened this issue Jun 28, 2019 · 5 comments

Comments

@yautah
Copy link

yautah commented Jun 28, 2019

如题
开启增强编译后
observable的属性的默认值无效,直接变为undefined或者null

@yautah
Copy link
Author

yautah commented Jun 28, 2019

在增强编译模式下

class TodoStore { todos = [1,2,3] } decorate(TodoStore,{ todos: observable })

这种写法,todos的默认值会被无情的干成null。

在constructor中给todos赋上初始值倒是可以

@windy
Copy link
Member

windy commented Jun 28, 2019

@yautah 写到 constructor 里可以解决问题吗

@yautah
Copy link
Author

yautah commented Jul 1, 2019

@windy 可以

@windy
Copy link
Member

windy commented Jul 1, 2019

@yautah 好的, 了解. 我有空补充一下相关内容.

@windy
Copy link
Member

windy commented Jul 1, 2019

image

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

2 participants