国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Uniapp之uni-ui-擴展組件(1)

這篇具有很好參考價值的文章主要介紹了Uniapp之uni-ui-擴展組件(1)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

uni組件符合easycom規(guī)范,HBuilderX 2.5.5起,只需將本組件導入項目,在頁面template中即可直接使用,無需在頁面中import和注冊components

HBuilder插件市場(uni-ui組件庫)

uni-ui不支持使用Vue.use()的方式安裝
npm安裝uni-ui庫(vue-cli項目需先安裝sass及sass-loader,HBuilder可省略)
安裝sass:npm i sass -D 或者 yarn add sass -D
安裝sass-loader(使用低于@11.0.0版本,sass-loader@11.0.0不支持vue@2.6.12):npm i sass-loader@10.1.1 -D 或者 yarn add sass-loader@10.1.1 -D
安裝uni-ui:npm i @dcloudio/uni-ui 或者 yarn add @dcloudio/uni-ui

script中引用組件:

import {uniBadge} from '@dcloudio/uni-ui'
//import uniBadge from '@dcloudio/uni-ui/lib/uni-badge/uni-badge.vue' //也可使用此方式引入組件
export default {
    components: {uniBadge}
}

在template中使用組件:

<uni-badge text="1"></uni-badge>
<uni-badge text="2" type="success" @click="bindClick"></uni-badge>
<uni-badge text="3" type="primary" :inverted="true"></uni-badge>

CLI引用方式:H5端不支持在main.js中全局注冊組件,可使用easyCom的方式引用組件
easyCom:傳統(tǒng)vue組件,需要安裝、引用、注冊三個步驟后才能使用組件,easyCom將其精簡為一步,只要組件安裝在項目的components目錄下,并符合components/組件名稱/組件名稱.vue目錄結(jié)構(gòu),就可以不用引用、注冊,直接在頁面中使用
使用npm安裝的組件,默認情況下babel-loader會省略所有node-modules中的文件,導致條件編譯失效,需要通過配置vue.config.js文件解決:

// 在根目錄創(chuàng)建 vue.config.js 文件,并配置如下
module.exports = {
transpileDependencies: ['@dcloudio/uni-ui']
}

使用npm+easycom

使用npm安裝好uni-ui之后,需要配置easycom規(guī)則,讓npm安裝的組件支持easycom
打開項目根目錄下的pages.json并添加easycom節(jié)點

// pages.json

{
    "easycom": {
        "autoscan": true,
        "custom": {
            // uni-ui 規(guī)則如下配置
            "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
        }
    },

    // 其他內(nèi)容
    pages:[
        // ...
    ]
}
  1. uni-badge:數(shù)字角標
<uni-badge size="small" :text="100" absolute="rightBottom" type="primary">
    <button type="default">右上</button>
</uni-badge>
<uni-badge text="1"></uni-badge>
<uni-badge text="2" type="purple" @click="bindClick"></uni-badge>
<uni-badge text="3" type="primary" :inverted="true"></uni-badge>

Uniapp之uni-ui-擴展組件(1)
Uniapp之uni-ui-擴展組件(1)

  1. uni-calendar:日歷
  • 本組件農(nóng)歷轉(zhuǎn)換使用的js是@1900-2100區(qū)間內(nèi)的公歷、農(nóng)歷互轉(zhuǎn)
  • date屬性傳入的應該是一個String,格式為:2019-06-01
  • 通過 insert 屬性來確定當前的事件是 @change 還是 @confirm 。理應合并為一個事件,但是為了區(qū)分模式,現(xiàn)使用兩個事件,這里需要注意
  • 彈窗模式下無法阻止后面的元素滾動,如有需要阻止,請在彈窗彈出后,手動設(shè)置滾動元素為不可滾動
<view>
    <uni-calendar 
    :insert="true"
    :lunar="true" 
    :start-date="'2019-3-2'"
    :end-date="'2019-5-20'"
    @change="change"
     />
</view>

通過方法打開日歷

<view>
    <uni-calendar 
    ref="calendar"
    :insert="false"
    @confirm="confirm"
     />
     <button @click="open">打開日歷</button>
</view>

export default {
    data() {
        return {};
    },
    methods: {
        open(){
            this.$refs.calendar.open();
        },
        confirm(e) {
            console.log(e);
        }
    }
};

Uniapp之uni-ui-擴展組件(1)
Uniapp之uni-ui-擴展組件(1)

  1. uni-card:卡片
  • 因為平臺兼容問題,目前APP-NVUE安卓平臺下不支持陰影
<!-- 一般用法 -->
<uni-card title="標題文字" thumbnail="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" extra="額外信息" note="Tips">
    內(nèi)容主體,可自定義內(nèi)容及樣式
</uni-card>

<!-- 內(nèi)容通欄 -->
<uni-card is-full="true" title="DCloud" thumbnail="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" extra="2018.12.12" >
    <image src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" style="width: 100%;"></image>
</uni-card>

<!-- 圖文卡片模式 -->
<uni-card
    title="標題文字"
    mode="style"
    :is-shadow="true"
    thumbnail="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
    extra="Dcloud 2019-05-20 12:32:19"
    note="Tips"
>
        uni-app 是一個使用 Vue.js 開發(fā)所有前端應用的框架,開發(fā)者編寫一套代碼,可編譯到iOS、Android、H5、以及各種小程序等多個平臺。即使不跨端,uni-app同時也是更好的小程序開發(fā)框架。
</uni-card>

<!-- 標題卡片模式 -->
<uni-card 
    title="Dcloud" 
    mode="title" 
    :is-shadow="true" 
    thumbnail="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png" 
    extra="技術(shù)沒有上限" 
    note="Tips"
>
    uni-app 是一個使用 Vue.js 開發(fā)所有前端應用的框架,開發(fā)者編寫一套代碼,可編譯到iOS、Android、H5、以及各種小程序等多個平臺。即使不跨端,uni-app同時也是更好的小程序開發(fā)框架。
</uni-card>

<!-- 自定義底部按鈕 -->
<uni-card title="Dcloud" note="true">
    默認內(nèi)容
    <template v-slot:footer>
        <view class="footer-box">
            <view>喜歡</view>
            <view>評論</view>
            <view>分享</view>
        </view>
    </template>
</uni-card>

Uniapp之uni-ui-擴展組件(1)
Uniapp之uni-ui-擴展組件(1)

  1. uni-collapse:折疊面板
  • 新增show-arrow屬性,控制是否顯示右側(cè)箭頭
  • 組件需要依賴sass插件
  • App端默認關(guān)閉組件動畫:因為height動畫開銷比較大,會導致頁面卡頓
  • 在小程序端組件內(nèi)容發(fā)生變化,需要手動調(diào)用resize()方法,手動更新幾點信息,避免出現(xiàn)內(nèi)容錯位
  • 如需自定義組件默認邊框顏色等,需使用插槽自定義內(nèi)容并合理使用bordertitle-border屬性
  • 組件支持nvue,需要在manifest.json>app-plus節(jié)點下配置"nvueStyleCompiler":"uni-app"
<uni-collapse>
    <uni-collapse-item title="默認開啟" :open="true">
        <text>折疊內(nèi)容</text>
    </uni-collapse-item>
    <uni-collapse-item title="折疊內(nèi)容">
            <text>折疊內(nèi)容</text>
    </uni-collapse-item>
    <uni-collapse-item title="禁用狀態(tài)" disabled>
        <text>折疊內(nèi)容</text>
    </uni-collapse-item>
</uni-collapse>

》手風琴效果:
使用accordion屬性,open屬性則生效在最后一個組件

<uni-collapse accordion>
    <uni-collapse-item title="手風琴效果">
        <text>折疊內(nèi)容</text>
    </uni-collapse-item>
    <uni-collapse-item title="手風琴效果">
            <text>折疊內(nèi)容</text>
    </uni-collapse-item>
    <uni-collapse-item title="禁用狀態(tài)" disabled>
        <text>折疊內(nèi)容</text>
    </uni-collapse-item>
</uni-collapse>

》動態(tài)設(shè)置折疊面板打開狀態(tài)

  • 使用v-model屬性,動態(tài)設(shè)置面板的顯示狀態(tài)
  • 使用name屬性設(shè)置每個面板的唯一標識,如不設(shè)置使用默認索引,從字符串"0"開始記數(shù)
  • v-model屬性最好不要和open屬性同時使用
  • accordion屬性值:
  • ”true“,類型為String
  • ”false“,類型為Array
<uni-collapse v-model="value">
    <uni-collapse-item name="key1" title="默認開啟">
        <text>折疊內(nèi)容</text>
    </uni-collapse-item>
    <uni-collapse-item name="key2" title="默認開啟">
            <text>折疊內(nèi)容</text>
    </uni-collapse-item>
    <uni-collapse-item name="key3" title="默認不開啟">
            <text>折疊內(nèi)容</text>
    </uni-collapse-item>
</uni-collapse>

export default {
    data(){
        return {
            value:['key1','key2'],
            // 如果設(shè)置了 accordion 屬性,則使用 string 類型
            // value:'key1'
        }
    }
}

》使用動畫
使用show-animation屬性開啟或關(guān)閉面板折疊動畫,默認動畫開啟

<uni-collapse>
    <uni-collapse-item :show-animation="true" title="開啟動畫">
        <text>折疊內(nèi)容</text>
    </uni-collapse-item>
    <uni-collapse-item :show-animation="true"  title="開啟動畫">
            <text>折疊內(nèi)容</text>
    </uni-collapse-item>
    <uni-collapse-item :show-animation="false"  title="不開啟動畫">
            <text>折疊內(nèi)容</text>
    </uni-collapse-item>
</uni-collapse>

》配置圖片
使用thumb配置圖片地址,可在面板左側(cè)顯示一個圖片

<uni-collapse>
    <uni-collapse-item title="標題文字"
        thumb="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png">
        <view class="content">
            <text class="text">折疊內(nèi)容主體,可自定義內(nèi)容及樣式</text>
        </view>
    </uni-collapse-item>
</uni-collapse>

》自定義插槽
如果需要自定義面板顯示,可以使用title插槽達成完全自定義
使用uni-list的列表示例,需引入uni-list組件
在折疊面板組件中使用list時,在App-Nvue下不要使用uni-list-item,會導致組件無法正常顯示,其他平臺不做限制
在默認插槽里使用uni-list組件與上方示例一樣,直接寫在默認插槽即可

<uni-collapse>
    <!-- 因為list默認帶一條分隔線,所以使用 titleBorder="none" 取消面板的分隔線 -->
    <uni-collapse-item title-border="none" :border="false">
        <template v-slot:title>
            <uni-list>
                <uni-list-item title="標題使用自定義標題插槽" :show-extra-icon="true" :extra-icon="extraIcon">
                </uni-list-item>
            </uni-list>
        </template>
        <view class="content">
            <text class="text">折疊內(nèi)容主體,可自定義內(nèi)容及樣式</text>
        </view>
    </uni-collapse-item>
</uni-collapse>

Uniapp之uni-ui-擴展組件(1)

Uniapp之uni-ui-擴展組件(1)

resize():更新當前列表高度

  • 解決動態(tài)添加數(shù)據(jù),帶動畫的折疊面板高度不更新的問題
  • 需要在數(shù)據(jù)渲染完畢之后使用resize方法=》推薦在this.$nextTick()中使用
  • 當前只有小程序端需要調(diào)用此方法,H5\App端已經(jīng)做了處理,不需要手動更新高度
<view>
  <uni-collapse ref="collapse" v-model="value">
      <uni-collapse-item title="默認開啟" >
          <view class="content">
              <text class="text">{{content}}</text>
          </view>
      </uni-collapse-item>
      <uni-collapse-item title="折疊內(nèi)容">
          <view class="content">
              <text class="text">折疊內(nèi)容主體,這是一段比較長內(nèi)容。默認折疊主要內(nèi)容,只顯示當前項標題。點擊標題展開,才能看到這段文字。再次點擊標題,折疊內(nèi)容。</text>
          </view>
      </uni-collapse-item>
  </uni-collapse>
  <button class="button" type="primary" @click="add">動態(tài)修改內(nèi)容</button>
</view>

export default {
data() {
  return {
      value:['0'],
      content: '折疊內(nèi)容主體,可自定義內(nèi)容及樣式,點擊按鈕修改內(nèi)容使高度發(fā)生變化。',
  }
},
methods: {
  add() {
      if (this.content.length > 35) {
          this.content = '折疊內(nèi)容主體,可自定義內(nèi)容及樣式,點擊按鈕修改內(nèi)容使高度發(fā)生變化。'
      } else {
          this.content = '折疊內(nèi)容主體,這是一段比較長內(nèi)容。通過點擊按鈕修改后內(nèi)容后,使組件高度發(fā)生變化,在次點擊按鈕恢復之前的內(nèi)容和高度。'
      }
      // TODO 小程序中不支持自動更新 ,需要手動resize 更新組件高度
      // #ifdef MP
      this.$nextTick(() => {
          this.$refs.collapse.resize()
      })
      // #endif
  }
}
}

Uniapp之uni-ui-擴展組件(1)

  1. uni-combox:組合框
  • 可以同時選擇和輸入的表單項
<uni-combox label="所在城市" :candidates="candidates" placeholder="請選擇所在城市" v-model="city"></uni-combox>

Uniapp之uni-ui-擴展組件(1)
Uniapp之uni-ui-擴展組件(1)

  1. uni-countdown:倒計時
<!-- 一般用法 -->
<uni-countdown :day="1" :hour="1" :minute="12" :second="40"></uni-countdown>

<!-- 不顯示天數(shù) -->
<uni-countdown :show-day="false" :hour="12" :minute="12" :second="12"></uni-countdown>

<!-- 修改顏色 -->
<uni-countdown color="#FFFFFF" background-color="#00B26A" border-color="#00B26A" :day="1" :hour="2" :minute="30" :second="0"></uni-countdown>

Uniapp之uni-ui-擴展組件(1)
Uniapp之uni-ui-擴展組件(1)

  1. uni-data-checkbox:數(shù)據(jù)選擇器
  • 數(shù)據(jù)綁定型組件:給本組件綁定一個data,會自動渲染一組候選內(nèi)容
  • 自動的表單校驗:組件綁定了data,且符合uni-forms組件的表單校驗規(guī)范,搭配使用會自動實現(xiàn)表單校驗
  • 本組件合并了單選和多選
  • uniCloun開發(fā)中,DB Schema中配置了enum枚舉等類型后,在web控制臺的自動生成表單功能中,會自動生成uni-data-checkbox組件并綁定好data
  • 本組件需依賴sass插件,需自行安裝
  • 本組件為數(shù)據(jù)驅(qū)動,目的是快速投入使用,只可通過style覆蓋有限樣式,不支持自定義更多樣式
  • 組件支持nvue,需要在manifest.json>app-plus節(jié)點下配置"nvueStyleCompiler":"uni-app"

設(shè)置localdata屬性后,組件會通過數(shù)據(jù)渲染出對應的內(nèi)容,默認顯示的是單選框
:multiple="false"時(單選),value/v-model的值是String|Number類型

<template>
    <view>
        <uni-data-checkbox v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
    </view>
</template>


export default {
    data() { 
        return {
            value: 0,
            range: [{"value": 0,"text": "籃球"    },{"value": 1,"text": "足球"},{"value": 2,"text": "游泳"}]
        }
    },
    methods: {
        change(e){
            console.log('e:',e);
        }
    }
}

》多選框

  • 設(shè)置multiple屬性,組件顯示為多選框
  • :multiple="true"時(多選),value/v-model的值是Array類型
<template>
    <view>
        <uni-data-checkbox multiple v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
    </view>
</template>

export default {
    data() { 
        return {
            value: [0,2],
            range: [{"value": 0,"text": "籃球"    },{"value": 1,"text": "足球"},{"value": 2,"text": "游泳"}]
        }
    },
    methods: {
        change(e){
            console.log('e:',e);
        }
    }
}

》設(shè)置最大最小值

  • :multiple="true"時(多選),可以設(shè)置min、max
  • 如果選中個數(shù)小于min屬性設(shè)置的值,則選擇內(nèi)容將不可取消,只有當選中個數(shù)大于等于min且小于`max``時,才可取消選中
  • 如果選中個數(shù)大于等于max屬性設(shè)置的值,那么其他未選中內(nèi)容將不可選
<template>
    <view>
        <uni-data-checkbox min="1" max="2" multiple v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
    </view>
</template>

export default {
    data() { 
        return {
            value: [0,2],
            range: [{"value": 0,"text": "籃球"    },{"value": 1,"text": "足球"},{"value": 2,"text": "游泳"}]
        }
    },
    methods: {
        change(e){
            console.log('e:',e);
        }
    }
}

》設(shè)置禁用

  • 禁用需要在localdata屬性的數(shù)據(jù)源中添加disable屬性
<template>
    <view>
        <uni-data-checkbox v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
    </view>
</template>

export default {
    data() { 
        return {
            value: 0,
            range: [{
                    "value": 0,
                    "text": "籃球"
                },
                {
                    "value": 1,
                    "text": "足球",
                    // 禁用當前項
                    "disable":true
                },
                {
                    "value": 2,
                    "text": "游泳"
                }
            ]
        }
    },
    methods: {
        change(e){
            console.log('e:',e);
        }
    }
}

》自定義選中顏色

  • 設(shè)置selectedColor屬性,可以修改組件選中后的圖標及邊框顏色
  • 設(shè)置selectedColor屬性,可以修改組件選中后的文字顏色,如不填寫默認同selectedColor屬性,mode屬性為tag時,默認為白色
<template>
    <view>
        <uni-data-checkbox selectedColor="red" selectedTextColor="red" multiple v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
    </view>
</template>

export default {
    data() { 
        return {
            value: [0,2],
            range: [{"value": 0,"text": "籃球"    },{"value": 1,"text": "足球"},{"value": 2,"text": "游泳"}]
        }
    },
    methods: {
        change(e){
            console.log('e:',e);
        }
    }
}

》更多模式

  • 設(shè)置mode屬性,可以設(shè)置更多顯示樣式,目前內(nèi)置樣式有四種default/list/button/tag
  • 如果需要禁用某項,需要在localdata屬性的數(shù)據(jù)源中添加disable屬性
<template>
    <view>
        <!-- 默認 default -->
        <uni-data-checkbox v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
        <!-- 列表 list ,顯示左側(cè)圖標 -->
        <uni-data-checkbox mode="list" icon="left" v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
        <!-- 列表 list ,顯示右側(cè)圖標 -->
        <uni-data-checkbox mode="list" icon="right" v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
        <!-- 按鈕 button -->
        <uni-data-checkbox mode="button" v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
        <!-- 標簽 tag -->
        <uni-data-checkbox mode="tag" v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
    </view>
</template>

export default {
    data() { 
        return {
            value: 0,
            range: [{"value": 0,"text": "籃球"    },{"value": 1,"text": "足球"},{"value": 2,"text": "游泳"}]
        }
    },
    methods: {
        change(e){
            console.log('e:',e);
        }
    }
}

Uniapp之uni-ui-擴展組件(1)
Uniapp之uni-ui-擴展組件(1)
Uniapp之uni-ui-擴展組件(1)文章來源地址http://www.zghlxwxcb.cn/news/detail-401586.html

到了這里,關(guān)于Uniapp之uni-ui-擴展組件(1)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權(quán),不承擔相關(guān)法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務器費用

相關(guān)文章

  • 【uniapp】在微信小程序中修改uni-ui組件樣式不生效的解決方案

    【uniapp】在微信小程序中修改uni-ui組件樣式不生效的解決方案

    在使用uniapp框架開發(fā)微信小程序時,使用到了uni-ui的uni-table組件。由于需要修改表頭的背景色,于是乎在微信開發(fā)工具中使用調(diào)試工具審查元素獲取其class名: 嘗試直接在頁面中修改樣式: 結(jié)果無效。于是嘗試使用深度選擇器 依然無效。然后查詢微信平臺官方開發(fā)文檔得知

    2024年02月02日
    瀏覽(101)
  • uniapp+vue3+vite+ts搭建項目引入uni-ui和uviewPlus組件庫

    一、創(chuàng)建項目架構(gòu) 首先使用官方提供的腳手架創(chuàng)建一個項目 在這里插入代碼片 ,這里我創(chuàng)建的 vue3 + vite + ts 的項目: (如命令行創(chuàng)建失敗,請直接訪問 gitee下載模板) 二、下載依賴 啟動 三、下載安裝包 引入uni-ui src/package.json 文件配置easycom模式 引入uview-plus main.ts配置 u

    2024年02月13日
    瀏覽(17)
  • 【uniapp】小程序開發(fā):2 安裝uni-ui組件庫、使用pinia狀態(tài)管理、自定義http請求

    【uniapp】小程序開發(fā):2 安裝uni-ui組件庫、使用pinia狀態(tài)管理、自定義http請求

    1、安裝 2、配置組件自動導入 使用 npm 安裝好 uni-ui 之后,需要配置 easycom 規(guī)則,讓 npm 安裝的組件支持 easycom 打開項目根目錄下的 pages.json 并添加 easycom 節(jié)點: 3、安裝插件,實現(xiàn)uni-ui組件的類型提示 安裝完成后,在 tsconfig.json 中增加配置項 4、測試使用 隨便復制一個組件在

    2024年02月08日
    瀏覽(21)
  • 使用uni-ui 實現(xiàn)下拉搜索框(uniapp+uni-ui+vue3 開發(fā)微信小程序)

    需求:輸入框中輸入內(nèi)容--遠端搜索匹配的選項--展示選項(可點擊選擇選項) 代碼實現(xiàn) htm:(一個輸入框input + list) js: css

    2024年01月24日
    瀏覽(20)
  • uni-ui組件庫uni-icons不顯示

    uni-ui組件庫uni-icons不顯示

    按照官方文檔用yarn引用了uni-ui組件庫并且在pages.json和vue.config.js中配置了相關(guān)的內(nèi)容后使用uni-icon效果如下: ? 使用uni-icons的地方圖標都未顯示成功 1-按照 項目名稱node_modules@dcloudiouni-uilibuni-icons目錄找到uni-icons目錄 2-將uni-icons目錄放到src目錄下的components目錄下 3-在pages

    2024年02月15日
    瀏覽(92)
  • uni-app自定義組件及拓展(uni-ui)組件的使用

    uni-app自定義組件及拓展(uni-ui)組件的使用

    UniApp 是一個基于 Vue.js 的跨平臺應用框架,可以用來開發(fā)同時運行在多個平臺(如微信小程序、支付寶小程序、App等)的應用程序。在 UniApp 中,組件的使用與 Vue.js 中的組件使用基本類似,但需要考慮跨平臺兼容性。 1. 創(chuàng)建組件文件 在 UniApp 項目中創(chuàng)建一個新的組件,通常

    2024年04月29日
    瀏覽(117)
  • uniapp collapse動態(tài)生成多個折疊面板手動展開收起(包括uni-ui版)

    uniapp collapse動態(tài)生成多個折疊面板手動展開收起(包括uni-ui版)

    官方文檔沒有暴露出相關(guān)api,那就看看組件源碼。 以下示例均通過? vue-cli ?創(chuàng)建的? uni-app ?h5 項目 源碼 node_modulesuview-uicomponentsu-collapse-itemu-collapse-item.vue 這個方法是用來改變折疊面板子組件收起還是展開的,根據(jù)改變 isShow 的值來實現(xiàn) 方法 源碼 node_modules@dcloudiouni-ui

    2024年02月06日
    瀏覽(38)
  • uni-ui 中 uni-file-picker組件限制用戶上傳大小超過大小自動去除

    uni-ui 中 uni-file-picker組件限制用戶上傳大小超過大小自動去除

    uni-ui 中 uni-file-picker組件限制用戶上傳大小超過大小自動去除 找到該組件位置打開uni-file-picker 在props中添加自己想起的名字綁定限制大小 找到chooseFileCallback方法插入代碼: 其他頁面調(diào)用即可

    2024年01月15日
    瀏覽(139)
  • uni-app開發(fā)使用uni-ui組件uni-data-checkbox編譯微信小程序報錯

    uni-app開發(fā)使用uni-ui組件uni-data-checkbox編譯微信小程序報錯

    uniapp開發(fā)使用uni-ui控件uni-data-checkbox,編譯成微信小程序報錯VM50 WAService.js:1 TypeError: Cannot read property \\\'length\\\' of undefined,并且頁面無法顯示。 ?解決方法: 1、 HBuilder X 編譯器下載 sass 或更新 HBuilder X 版本 2、更新uni-ui組件庫 3、如果不使用uniCloud就注釋uni-data-checkbox.vue文件中的

    2024年02月06日
    瀏覽(40)
  • uni-app uni-ui 微信小程序 uni-datetime-picker 時間選擇組件設(shè)置start和end屬性,實現(xiàn)時間選擇限制

    uni-app uni-ui 微信小程序 uni-datetime-picker 時間選擇組件設(shè)置start和end屬性,實現(xiàn)時間選擇限制

    ?效果如圖,先選擇開始日期,完成日期需要在開始日期之后,先選擇完成日期,開始日期需要在完成日期之前 需要用到uni-datetime-picker官方的三個屬性? 代碼如下 這樣一個能夠限制選定范圍的組件就ok了! ? ?

    2024年02月11日
    瀏覽(93)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包