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

微信小程序/vue3/uview-plus form兜底校驗

這篇具有很好參考價值的文章主要介紹了微信小程序/vue3/uview-plus form兜底校驗。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

效果圖

微信小程序/vue3/uview-plus form兜底校驗,微信小程序

代碼

<template>
    <u-form :model="form" ref="formRole" :rules="rules">
        <u-form-item prop="nickname">
            <u-input v-model="form.nickname" placeholder="姓名" border="none" />
        </u-form-item>
        <u-form-item prop="password">
            <u-input v-model="form.password" placeholder="密碼" border="none" />
        </u-form-item>
        <button @click="submit" class="btn">提交</button>
    </u-form>
</template>

<script setup lang="ts">
    import { reactive, ref } from 'vue';
    const formRole = ref<any>(null);
    const rules = {
        'password': {
            type: 'string',
            required: true,
            message: '請輸入密碼',
            trigger: ['blur', 'change'],
        },
        'nickname': {
            type: 'string',
            required: true,
            message: '請輸入名稱',
            trigger: ['blur', 'change'],
        }
    }
    const form = reactive({
        nickname: null,
        password: null,
    });
    const submit = () => {
        console.log(formRole.value, 'formRole.value');
        formRole.value.validate().then(res => {
            // uni.$u.toast('校驗通過')
            console.log(res, '成功');
            // return
        }).catch(err => {
            console.log(err, '校驗失敗');
            // return
        })
    };
</script>

經(jīng)驗之談

1. :model=‘form’

若把form的值設置為 空對象? const form = reactive({? });

控制臺報錯?

微信小程序/vue3/uview-plus form兜底校驗,微信小程序?

2.?不能把 prop 寫為name 否則沒有任何效果

微信小程序/vue3/uview-plus form兜底校驗,微信小程序文章來源地址http://www.zghlxwxcb.cn/news/detail-725494.html

到了這里,關(guān)于微信小程序/vue3/uview-plus form兜底校驗的文章就介紹完了。如果您還想了解更多內(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)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關(guān)文章

  • 基于uniapp+vite4+vue3搭建跨端項目|uni-app+uview-plus模板

    基于uniapp+vite4+vue3搭建跨端項目|uni-app+uview-plus模板

    最近得空學習了下uniapp結(jié)合vue3搭建跨端項目。之前也有使用uniapp開發(fā)過幾款聊天/仿抖音/后臺管理等項目,但都是基于vue2開發(fā)。隨著vite.js破局出圈,越來越多的項目偏向于vue3開發(fā),就想著uniapp搭配vite4.x構(gòu)建項目效果會如何?經(jīng)過一番嘗試果然真香~ uniapp官網(wǎng)提供了? HBuild

    2024年02月09日
    瀏覽(95)
  • uniapp----微信小程序 日歷組件(周日歷&& 月日歷)【Vue3+ts+uView】

    uniapp----微信小程序 日歷組件(周日歷&& 月日歷)【Vue3+ts+uView】

    用Vue3+ts+uView來編寫日歷組件; 存在周日歷和月日歷兩種顯示方式; 高亮顯示當天日期,紅點渲染有數(shù)據(jù)的日期,點擊顯示數(shù)據(jù) 1. calendar-week-mouth組件代碼 2. 在頁面引用組件

    2024年02月04日
    瀏覽(108)
  • uniapp--- 微信小程序 用戶隱私新規(guī)相關(guān)代碼調(diào)整【vue3+ts+uView框架】

    uniapp--- 微信小程序 用戶隱私新規(guī)相關(guān)代碼調(diào)整【vue3+ts+uView框架】

    官方公告地址:https://developers.weixin.qq.com/community/develop/doc/00042e3ef54940ce8520e38db61801 用戶隱私保護指引填寫說明地址:https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/ 1) 需要在9月15前更新完畢,否則會無法使用獲取手機號 手機相冊等相關(guān)信息。 2) 微信小程序開發(fā)工具

    2024年02月09日
    瀏覽(30)
  • uniapp:uview-plus的一些記錄

    customStyle 并不是所有的組件都有customStyle屬性來設置自定義屬性,有的還是需要通過::v-deep來修改內(nèi)置樣式 form表單 labelStyle 需要的是一個對象 dateTimePicker選擇器設置默認值 根據(jù)文檔設置defaultIndex未生效,通過網(wǎng)上查閱文章得到方法,通過設置dateTimePicker的innerValue屬性來設置

    2024年04月11日
    瀏覽(22)
  • uniapp微信小程序投票系統(tǒng)實戰(zhàn) (SpringBoot2+vue3.2+element plus ) -用戶投票實現(xiàn)

    鋒哥原創(chuàng)的uniapp微信小程序投票系統(tǒng)實戰(zhàn): uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )_嗶哩嗶哩_bilibili uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )共計21條視頻,包括:uniapp微信小程序投票系統(tǒng)實

    2024年01月23日
    瀏覽(18)
  • uniapp微信小程序投票系統(tǒng)實戰(zhàn) (SpringBoot2+vue3.2+element plus ) -投票帖子明細實現(xiàn)

    uniapp微信小程序投票系統(tǒng)實戰(zhàn) (SpringBoot2+vue3.2+element plus ) -投票帖子明細實現(xiàn)

    鋒哥原創(chuàng)的uniapp微信小程序投票系統(tǒng)實戰(zhàn): uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )_嗶哩嗶哩_bilibili uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )共計21條視頻,包括:uniapp微信小程序投票系統(tǒng)實

    2024年01月22日
    瀏覽(29)
  • uniapp微信小程序投票系統(tǒng)實戰(zhàn) (SpringBoot2+vue3.2+element plus ) -投票帖子詳情實現(xiàn)

    uniapp微信小程序投票系統(tǒng)實戰(zhàn) (SpringBoot2+vue3.2+element plus ) -投票帖子詳情實現(xiàn)

    鋒哥原創(chuàng)的uniapp微信小程序投票系統(tǒng)實戰(zhàn): uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )_嗶哩嗶哩_bilibili uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )共計21條視頻,包括:uniapp微信小程序投票系統(tǒng)實

    2024年01月16日
    瀏覽(26)
  • uniapp微信小程序投票系統(tǒng)實戰(zhàn) (SpringBoot2+vue3.2+element plus ) -投票帖子排行實現(xiàn)

    uniapp微信小程序投票系統(tǒng)實戰(zhàn) (SpringBoot2+vue3.2+element plus ) -投票帖子排行實現(xiàn)

    鋒哥原創(chuàng)的uniapp微信小程序投票系統(tǒng)實戰(zhàn): uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )_嗶哩嗶哩_bilibili uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )共計21條視頻,包括:uniapp微信小程序投票系統(tǒng)實

    2024年01月19日
    瀏覽(20)
  • uniapp微信小程序投票系統(tǒng)實戰(zhàn) (SpringBoot2+vue3.2+element plus ) -全局異常統(tǒng)一處理實現(xiàn)

    uniapp微信小程序投票系統(tǒng)實戰(zhàn) (SpringBoot2+vue3.2+element plus ) -全局異常統(tǒng)一處理實現(xiàn)

    鋒哥原創(chuàng)的uniapp微信小程序投票系統(tǒng)實戰(zhàn): uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )_嗶哩嗶哩_bilibili uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )共計21條視頻,包括:uniapp微信小程序投票系統(tǒng)實

    2024年02月03日
    瀏覽(23)
  • uniapp微信小程序投票系統(tǒng)實戰(zhàn) (SpringBoot2+vue3.2+element plus ) -我創(chuàng)建的投票列表實現(xiàn)

    uniapp微信小程序投票系統(tǒng)實戰(zhàn) (SpringBoot2+vue3.2+element plus ) -我創(chuàng)建的投票列表實現(xiàn)

    鋒哥原創(chuàng)的uniapp微信小程序投票系統(tǒng)實戰(zhàn): uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )_嗶哩嗶哩_bilibili uniapp微信小程序投票系統(tǒng)實戰(zhàn)課程 (SpringBoot2+vue3.2+element plus ) ( 火爆連載更新中... )共計21條視頻,包括:uniapp微信小程序投票系統(tǒng)實

    2024年01月21日
    瀏覽(25)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領取紅包

二維碼2

領紅包