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

调用vue的属性方法时拿不到v-for 变量 #373

Closed
Tibbersss opened this issue May 7, 2019 · 2 comments
Closed

调用vue的属性方法时拿不到v-for 变量 #373

Tibbersss opened this issue May 7, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@Tibbersss
Copy link

系统信息:

  • 发行平台: [微信小程序]
  • 操作系统 [mac]
  • HBuilderX版本 [1.9.4]
  • 设备信息 [小程序开发工具]
    如图,第一个@click调用本vue页面的methods,可行
    第二个@click调用全局方法,不可行,看报错是去拿了本vue页面的data属性,但实际上应该优先拿v-for里的变量

3AFF9415575F0E5F67A1E9A79008A431
D199AD4BA6C3AB3C67E48DD9221E3238

@fxy060608 fxy060608 added the bug Something isn't working label May 8, 2019
@fxy060608
Copy link
Collaborator

fxy060608 commented May 8, 2019

建议将$store.commit 封装到一个方法里执行,类似第一种用法
$store.commit 的写法属于复杂表达式,使用这种复杂写法,编译至微信时,编译器和运行时均要做很多额外工作,尤其是在 v-for 中,可能会导致性能问题。

@Tibbersss
Copy link
Author

好的,理解:kissing_heart:

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

3 participants