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

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>
主站蜘蛛池模板: 稷山县| 新宁县| 长阳| 丰台区| 长治县| 读书| 康定县| 客服| 麻阳| 嵩明县| 奉新县| 海门市| 莎车县| 九寨沟县| 化州市| 平泉县| 南江县| 临泉县| 凤山市| 遂昌县| 尼木县| 龙州县| 鹤庆县| 富裕县| 宿松县| 福州市| 乐陵市| 准格尔旗| 济南市| 瑞安市| 左权县| 湖州市| 建瓯市| 涞源县| 北碚区| 新建县| 阳新县| 浙江省| 湄潭县| 庆阳市| 三门峡市|