<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://cdn.bootcss.com/vue/2.5.21/vue.js"></script>
</head>
<body>
<div id="app">
<p> {{msg|forMate('疯狂','臭逼')|test}}
</p>
</div>
<script>
Vue.filter('forMate',function(msg,arg,arg1){
return msg.replace(/单纯/g,arg+arg1)
})
Vue.filter('test',function(msg){
return msg+'~~~~~'
})
var vm = new Vue({
el: '#app',
data:{
msg:'曾将的我也是一个单纯的少年,单纯的我傻傻的问,谁是世界上最单纯的男人'
},
methods:{
}
});
</script>
</body>
</html>