script判断了除2余0的结果。
html>
<html>
<head>
<meta charset&#61;"utf-8">
<title>title>
<script src&#61;"vue.js" type&#61;"text/Javascript" charset&#61;"utf-8">script>
head>
<body>
<div id&#61;"app">
<li v-for&#61;"n in evenNumbers">{{ n }}li>
div>
<script type&#61;"text/Javascript">
var vm &#61; new Vue({
el: &#39;#app&#39;,
data: {
numbers: [ 1, 2, 3, 4, 5 ]
},
computed: {
evenNumbers: function () {
return this.numbers.filter(function (number) {
return number % 2 &#61;&#61;&#61; 0
})
}
}
});
script>
style>
body>
html>