Vue 模板是通过指令和插值增强的 HTML — 你编写看起来像 HTML 的标记,加上特殊属性(指令,以 v- 开头)和 {{ }} 用于动态值。
文本插值(mustaches)
vue
<template>
<h1>{{ title }}</h1> <!-- inserts the value of `title` -->
<p>{{ count * 2 }}</p> <!-- any JS expression works -->
<p>{{ isActive ? "On" : "Off" }}</p> <!-- ternaries, method calls, etc. -->
</template>
{{ }} 计算一个 JavaScript 表达式(不是语句)并将结果呈现为文本,当数据更改时自动更新。
