zoukankan      html  css  js  c++  java
  • uni-app 自定义组件的创建和使用

    开发工具:HbuilderX

    组件的创建:

    根目录下--》新建--》新建目录(compenents)--》目录下 新建组件(test)--》使用默认模版 

    【test.vue即为组件文件】

    组件的使用:

    //index.vue

    <script>
      //(1)引入 import test from '../../components/test.vue'
      export
    default {   //(2)注册 components:{ test,//"test":test 缩写为test } } </script>

    <template>
      <view class="content">
        <test></test> //(3)使用组件:

      </view>
    </template>

  • 相关阅读:
    6-1
    4-9
    4-5
    4-4
    4-3
    3-10
    作业三2
    作业三1
    课堂练习二
    实验三
  • 原文地址:https://www.cnblogs.com/cdj61/p/12886889.html
Copyright © 2011-2022 走看看