花括号表达式的用法

Posted liuyang-520

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了花括号表达式的用法相关的知识,希望对你有一定的参考价值。

1、案例1

<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>花括号表达式</title>
</head>

<body>
    <div id="app">
        <input type="text" v-model="username" />
        <p>Hello{{username}}</p>
        <p>{{msg}}</p>
        <p>{{msg.toUpperCase()}}</p>
    </div>
    <script src="../js/vue.js" type="text/javascript"></script>
    <script>
        const vm = new Vue({
            el: "#app",
            data: {
                username: "liuyang",
                msg: "<a href=‘http://www.baidu.com‘>百度</a>"
            }
        });
    </script>
</body>

</html>

 

运行结果:

技术图片

 

以上是关于花括号表达式的用法的主要内容,如果未能解决你的问题,请参考以下文章

{} 花括号的用法

vue 过滤器用法

cp,mv等花括号用法

如何理解这段代码片段中的两对括号?

如何用正则表达式匹配括号中的内容,不包含括号

如何用正则表达式匹配括号中的内容。