vue5 过滤器 模版

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>智能社——http://www.zhinengshe.com</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <style>
        .red{
            color: red;
        }
        .blue{
            background: blue;
        }
    </style>
    <script src="vue.js"></script>
    <script>
        window.onload=function(){
            new Vue({
                el:'#box',
                data:{
                    msg:'abc'
                }
            });
        };
    </script>
</head>
<body>
    <div id="box">
        <input type="text" v-model="msg">
        <br>
        {{msg}}
        <br>
        {{*msg}}   //后面更新不更新
        <br>
        {{{msg}}}   //解析html<h1></h1>
    </div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>智能社——http://www.zhinengshe.com</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <style>
        .red{
            color: red;
        }
        .blue{
            background: blue;
        }
    </style>
    <script src="vue.js"></script>
    <script>
        window.onload=function(){
            new Vue({
                el:'#box',
                data:{
                }
            });
        };
    </script>
</head>
<body>
    <div id="box">
        {{'welcome'|uppercase}}  //转大写过滤器
                <br>
        {{'WELCOME'|lowercase}}
        {{'WELCOME'|lowercase|capitalize}}   //首字母大写过滤器
        {{12|currency '¥'}}  //¥12.00
        {{12|currency}}  // $12.00
    </div>
</body>
</html>
原文地址:https://www.cnblogs.com/yaowen/p/6974268.html