在使用计算属性的时候,有时需要带参数。正确的写法如下:
...
computed:{
test: function () {
return a=>{
return this.attr1+ ' ' + a
}
}
}
...
<a>{{ test ('x-y-x')}}</a>
使用闭包。
在使用计算属性的时候,有时需要带参数。正确的写法如下:
...
computed:{
test: function () {
return a=>{
return this.attr1+ ' ' + a
}
}
}
...
<a>{{ test ('x-y-x')}}</a>
使用闭包。