0%

$emit 传递一个参数
1
2
3
4
5
6
7
8
//子组件
this.$emit('changeValue',value);

//父组件
<posilCom @changeValue="handleValue(val)"></posilCom>
handleValue(val) {
this.val = val;
}
阅读全文 »

过滤器可以串联

1
{{ message | filterA | filterB }}

在这个例子中,filterA 被定义为接收单个参数的过滤器函数,表达式 message 的值将作为参数传入到函数中。然后继续调用同样被定义为接收单个参数的过滤器函数 filterB,将 filterA 的结果传递到 filterB 中。

阅读全文 »