官术网_书友最值得收藏!

Templates

By default, Vue will use an HTML file for its template. An included script will declare an instance of Vue and use theelproperty in the configuration object to tell Vue where in the template the app will be mounted:

<p id="app">
  <!--Vue has dominion within this node-->
</p>
<script>
  new Vue({
    el: '#app'
  });
</script>

We can bind data to our template by creating it as adataproperty and using the mustache syntax to print it in the page:

<p id="app">
  {{ message }}
  <!--Renders as "Hello World"-->
</p>
<script>
  new Vue({
    el: '#app',
    data: {
      message: 'Hello World'
    }
  });
</script>
主站蜘蛛池模板: 化隆| 浠水县| 怀集县| 澄江县| 阿勒泰市| 惠来县| 宁德市| 佛冈县| 滦南县| 昌吉市| 清涧县| 辛集市| 沙田区| 界首市| 白山市| 双桥区| 长治市| 遵义县| 临洮县| 平谷区| 康保县| 高青县| 东方市| 新闻| 巢湖市| 泾川县| 剑川县| 越西县| 石泉县| 云和县| 绩溪县| 治县。| 岫岩| 博白县| 东乌珠穆沁旗| 壤塘县| 洛宁县| 陇南市| 西乡县| 灵璧县| 宝坻区|