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

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>
主站蜘蛛池模板: 阜平县| 岳阳县| 马公市| 工布江达县| 东乡族自治县| 托克逊县| 浦北县| 米林县| 绥宁县| 镇宁| 丰城市| 博白县| 文山县| 博乐市| 舒兰市| 信丰县| 方城县| 呈贡县| 武威市| 台中市| 运城市| 台南县| 新干县| 桓台县| 抚远县| 准格尔旗| 阳泉市| 深泽县| 合作市| 商水县| 柘荣县| 穆棱市| 斗六市| 凌云县| 锡林郭勒盟| 运城市| 普定县| 天水市| 张家界市| 五河县| 九龙城区|