<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="app">
<h1>{{price|f('万')|f('英镑')|h}}</h1>
</div>
<div id="bbb">
<h1>{{sss|h}}</h1>
</div>
<script src="./vue2.6.14.js"></script>
<script>
Vue.filter('h', (val) => val.split('').reverse().join('') )
let vm = new Vue({
el: "#app",
data: {
price: '100',
str: 'hello'
},
filters: {
f: function (val, d) {
console.log(val, d);
return val + d;
}
}
});
let vm2 = new Vue({
el: '#bbb',
data: {
sss: "nihao"
}
})
</script>
</body>
</html>