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

小程序中 v-for 循环的items不支持方法调用 #2012

Closed
torns opened this issue Aug 13, 2020 · 0 comments
Closed

小程序中 v-for 循环的items不支持方法调用 #2012

torns opened this issue Aug 13, 2020 · 0 comments
Assignees

Comments

@torns
Copy link

torns commented Aug 13, 2020

小程序中 v-for 循环的items不支持方法调用,如:html<li v-for="n in even(set)">{{ n }}</li>中的even方法在web版会被执行,在小程序版就未被执行.

<ul v-for="set in sets">
  <li v-for="n in even(set)">{{ n }}</li>
</ul>

data: {
  sets: [[ 1, 2, 3, 4, 5 ], [6, 7, 8, 9, 10]]
},
methods: {
  even: function (numbers) {
    return numbers.filter(function (number) {
      return number % 2 === 0
    })
  }
}
@zhetengbiji zhetengbiji self-assigned this Aug 14, 2020
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