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

computed 属性无法向子组件传递 #187

Closed
wulunyi opened this issue Jun 11, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@wulunyi
Copy link

commented Jun 11, 2017

No description provided.

@Gcaufy

This comment has been minimized.

Copy link
Collaborator

commented Jun 12, 2017

computed 是无法传向子组件的,但是可以这么写啊。

<child :data="mydata"></child>

data: {
   mydata: null
}

computed = {
   mycomputed () {
      this.mydata = calc();
      return this.mydata;
   }
}
@wulunyi

This comment has been minimized.

Copy link
Author

commented Jun 12, 2017

ok

@Gcaufy Gcaufy closed this Jun 13, 2017

@coolhwm

This comment has been minimized.

Copy link

commented Jul 3, 2017

@Gcaufy
貌似这样写也不行......有在appdata面板显示出来,但是子组件没接收到

@Gcaufy

This comment has been minimized.

Copy link
Collaborator

commented Jul 4, 2017

@coolhwm 上面例子如果要让子组件收到数据是少写了个.sync的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.