一.组件的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文件,用于单页/多页应用中,不同于以上两种全局组件。

内容来源于网络如有侵权请私信删除
你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!