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

mixin 中定义的方法,不能在 page 的 this 中访问。 #44

Closed
shenqihui opened this issue Feb 19, 2017 · 2 comments
Closed

mixin 中定义的方法,不能在 page 的 this 中访问。 #44

shenqihui opened this issue Feb 19, 2017 · 2 comments

Comments

@shenqihui
Copy link
Contributor

export default class extends wepy.mixin {
  func1 = function () {}

  func2 () {}
}

如上的 mixin ,在 pagesthis 中,只能调用 this.func1, 不能调用 this.func2func2 没有挂载到 this 上。具体原因,初步推断为 classprototype 属性不能枚举造成的。而实例属性能枚举,因此能挂载,所以 this 上能调用。

@shenqihui shenqihui changed the title mixin 中定义的方法,不能再 page 的 this 中访问。 mixin 中定义的方法,不能在 page 的 this 中访问。 Feb 19, 2017
@Gcaufy
Copy link
Collaborator

Gcaufy commented Feb 20, 2017

@menghuanCode
Copy link

现在可以在page访问,不过会报一个Missing files 的錯誤

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