Vue knowledge induction vue v-text of the instruction (b)

It will be described herein:

  • Substantially v-text using the instruction
  • The difference between the difference v-text expressions

1 Brief

v-text element will be output as plain text

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=divice-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vue v-text指令</title>
</head>

<body>
    <div id="app">
        <!-- 直接引用 -->
        <h3 v-text="message"></h3>
        <!-- 拼接一点数据 -->
        <h3 v-text="message+'这里是拼接的数据'"></h3>
        <h3>差值表达式引用 {{message}}</h3>
    </div>
    <!-- 开发环境版本,包含了有帮助的命令行警告 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                message: "hellow world"
            }
        })
    </script>
</body>

</html>

effect:
Here Insert Picture Description

Note 2:

{} {} Used to refer to the difference between the expression data, the data will replace the contents inside the {}
using v-text, all the data in all of the corresponding tag would be replaced

Published 354 original articles · won praise 180 · Views 450,000 +

Guess you like

Origin blog.csdn.net/zl18603543572/article/details/103338500