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

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>
主站蜘蛛池模板: 涡阳县| 山东省| 临朐县| 哈巴河县| 广昌县| 黄浦区| 甘谷县| 商南县| 濮阳县| 淮安市| 库车县| 莎车县| 休宁县| 陆良县| 临高县| 九江县| 新民市| 株洲市| 三门峡市| 东兰县| 滁州市| 扶风县| 淳化县| 绥滨县| 阳朔县| 青岛市| 虎林市| 辉县市| 德江县| 尚志市| 寿阳县| 区。| 石泉县| 阿克苏市| 当雄县| 类乌齐县| 西吉县| 兴业县| 乌兰浩特市| 平山县| 正宁县|