-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample-9.html
More file actions
31 lines (31 loc) · 823 Bytes
/
example-9.html
File metadata and controls
31 lines (31 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<html>
<head>
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui" name="viewport">
</head>
<body>
<div id="app">
<!-- 过滤器 -->
{{ data | filterA(argu1, 'argu2') }}
<div v-bind:inner-text.prop="data | filterA(argu1, 'argu2') | filterB"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script>
var vm = new Vue({
el: '#app',
data: {
data: 'vue.js',
argu1: true
},
filters: {
filterA (data, argu1, argu2) {
console.log(data, argu1, argu2);
return argu1 ? data : argu2
},
filterB (val) {
return 'processed by B: ' + val
}
}
})
</script>
</body>
</html>