vue组件

一.组件的3种使用方式

  1. 使用<script>标签。
    <body>
      <script type="text/x-template" id="component">
          <div>This is a component!</div>
      </script>
    </body>
  2. 使用<template>标签。
    <body>
       <template id="component">
           <div>This is a component!</div>
       </template>
    </body>
  3. 单文件组件

    *.vue文件,用于单页/多页应用中,不同于以上两种全局组件。

posted @ 2018-05-14 18:05  Hi娜娜  阅读(205)  评论(0编辑  收藏  举报