最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Vue3+antDesignVue實(shí)現(xiàn)表單校驗(yàn)的方法

 更新時(shí)間:2024年01月19日 09:43:23   作者:m87里的光  
這篇文章主要為大家詳細(xì)介紹了基于Vue3和antDesignVue實(shí)現(xiàn)表單校驗(yàn)的方法,文中的示例代碼講解詳細(xì),具有一定的參考價(jià)值,需要的小伙伴可以了解下

<a-form
      ref="form"
      :model="form"
      :rules="rules"
      :label-col="{ md: { span: 6 }, sm: { span: 24 } }"
      :wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
    >
      <!--      <a-form-item label='創(chuàng)建人:' name='createdBy'>-->
      <!--        <a-input-number v-model:value='form.createdBy' placeholder='請(qǐng)輸入創(chuàng)建人' allow-clear autocomplete='off' style="width: 100%" />-->
      <!--      </a-form-item>-->
 
      <a-form-item label="項(xiàng)目編號(hào):" name="projectCode">
        <a-input v-model:value="form.projectCode" placeholder="請(qǐng)輸入項(xiàng)目編號(hào)" style="width: 50%" allow-clear autocomplete="off" />
      </a-form-item>
      <a-form-item label="項(xiàng)目名稱:" name="projectName">
        <a-input v-model:value="form.projectName" placeholder="請(qǐng)輸入項(xiàng)目名稱" style="width: 50%" allow-clear autocomplete="off" />
      </a-form-item>
      <a-form-item label="項(xiàng)目承擔(dān)單位:" name="company">
        <a-input v-model:value="form.company" placeholder="請(qǐng)輸入項(xiàng)目承擔(dān)單位" style="width: 50%" allow-clear autocomplete="off" />
      </a-form-item>
      <a-form-item label="項(xiàng)目目的和意義:" name="purpose">
        <a-textarea v-model:value="form.purpose" placeholder="請(qǐng)輸入項(xiàng)目目的和意義" style="width: 50%" allow-clear autocomplete="off" />
      </a-form-item>
      <a-form-item label="技術(shù)水平:" name="level">
        <a-select
          ref="select"
          v-model:value="form.level"
          style="width: 40%"
          placeholder="請(qǐng)選擇技術(shù)水平"
          @focus="focus"
          @change="handleChange"
        >
          <a-select-option value="國(guó)際先進(jìn)">國(guó)際先進(jìn)</a-select-option>
          <a-select-option value="國(guó)際領(lǐng)先">國(guó)際領(lǐng)先</a-select-option>
          <a-select-option value="國(guó)內(nèi)先進(jìn)">國(guó)內(nèi)先進(jìn)</a-select-option>
          <a-select-option value="國(guó)內(nèi)領(lǐng)先">國(guó)內(nèi)領(lǐng)先</a-select-option>
        </a-select>
      </a-form-item>
      <a-form-item label="項(xiàng)目類型:" name="projectType">
        <a-select
          ref="select"
          v-model:value="form.projectType"
          placeholder="請(qǐng)選擇項(xiàng)目類型"
          style="width: 40%"
          @focus="focus"
          @change="handleChange"
        >
          <a-select-option value="產(chǎn)學(xué)研合作">產(chǎn)學(xué)研合作</a-select-option>
          <a-select-option value="自主研發(fā)">自主研發(fā)</a-select-option>
          <a-select-option value="其他">其他</a-select-option>
        </a-select>
      </a-form-item>
      <a-form-item label="項(xiàng)目主要內(nèi)容:" name="content">
        <a-textarea v-model:value="form.content" placeholder="請(qǐng)輸入項(xiàng)目主要內(nèi)容" style="width: 50%" allow-clear autocomplete="off" />
      </a-form-item>
      <a-form-item label="項(xiàng)目前期準(zhǔn)備工作、調(diào)研計(jì)劃:" name="plan">
        <a-textarea
          v-model:value="form.plan"
          placeholder="請(qǐng)輸入項(xiàng)目前期準(zhǔn)備工作、調(diào)研計(jì)劃"
          style="width: 50%"
          allow-clear
          autocomplete="off"
        />
      </a-form-item>
      <a-form-item label="項(xiàng)目預(yù)計(jì)科技投入總額:" name="investment">
        <a-input-number
          v-model:value="form.investment"
          placeholder="請(qǐng)輸入項(xiàng)目預(yù)計(jì)科技投入總額"
          style="width: 50%"
          allow-clear
          autocomplete="off"
          addon-before="RMB"
          addon-after="萬(wàn)元"
        />
      </a-form-item>
      <a-form-item label="前期準(zhǔn)備工作進(jìn)展、項(xiàng)目調(diào)研進(jìn)展:" name="progress">
        <a-textarea
          v-model:value="form.progress"
          placeholder="請(qǐng)輸入前期準(zhǔn)備工作進(jìn)展、項(xiàng)目調(diào)研進(jìn)展"
          style="width: 50%"
          allow-clear
          autocomplete="off"
        />
      </a-form-item>
      <a-form-item label="已累計(jì)投入總額:" name="spent">
        <a-input-number
          v-model:value="form.spent"
          placeholder="請(qǐng)輸入已累計(jì)投入總額"
          style="width: 50%"
          allow-clear
          autocomplete="off"
          addon-before="RMB"
          addon-after="萬(wàn)元"
        />
      </a-form-item>
      <a-form-item label="項(xiàng)目調(diào)研報(bào)告(或總結(jié)):" name="report">
        <a-upload
          name="file"
          ref="uploadRef"
          class="upload-list"
          v-model:file-list="fileList"
          :multiple="false"
          :action="FileUploadUrl"
          :headers="headers"
          :before-upload="beforeUpload"
          :custom-request="customRequest"
          @change="handleChange"
          @remove="handleRemove"
        >
          <a-button v-if="fileList.length < 1">
            <template #icon>
              <CloudUploadOutlined />
            </template>
            <span>選擇文件</span>
          </a-button>
        </a-upload>
      </a-form-item>
    </a-form>

 data() {
    return {
      fileList: [],
 
      // 表單數(shù)據(jù)
      form: Object.assign({}, this.data),
      // 表單驗(yàn)證規(guī)則
      rules: {
        createdBy: [{ required: true, message: '請(qǐng)輸入創(chuàng)建人', type: 'number', trigger: 'blur' }],
        projectName: [{ required: true, message: '請(qǐng)輸入項(xiàng)目名稱', type: 'string', trigger: 'blur' }],
        company: [{ required: true, message: '請(qǐng)輸入項(xiàng)目承擔(dān)單位', type: 'string', trigger: 'blur' }],
        purpose: [{ required: true, message: '請(qǐng)輸入項(xiàng)目目的和意義', type: 'string', trigger: 'blur' }],
        level: [{ required: true, message: '請(qǐng)輸入技術(shù)水平', type: 'string', trigger: 'blur' }],
        projectType: [{ required: true, message: '請(qǐng)輸入項(xiàng)目類型', type: 'string', trigger: 'blur' }],
        content: [{ required: true, message: '請(qǐng)輸入項(xiàng)目主要內(nèi)容', type: 'string', trigger: 'blur' }],
        plan: [{ required: true, message: '請(qǐng)輸入項(xiàng)目前期準(zhǔn)備工作、調(diào)研計(jì)劃', type: 'string', trigger: 'blur' }],
        investment: [{ required: true, message: '請(qǐng)輸入項(xiàng)目預(yù)計(jì)科技投入總額', type: 'number', trigger: 'blur' }],
        postTime: [{ required: true, message: '請(qǐng)輸入', type: 'string', trigger: 'blur' }],
        status: [{ required: true, message: '請(qǐng)輸入', type: 'string', trigger: 'blur' }],
        progress: [{ required: true, message: '請(qǐng)輸入前期準(zhǔn)備工作進(jìn)展、項(xiàng)目調(diào)研進(jìn)展', type: 'string', trigger: 'blur' }],
        report: [{ required: true, message: '請(qǐng)輸入項(xiàng)目調(diào)研報(bào)告(或總結(jié))', type: 'change', trigger: 'blur' }],
        projectCode: [{ required: true, message: '請(qǐng)輸入項(xiàng)目編號(hào)', type: 'string', trigger: 'blur' }],
        spent: [{ required: true, message: '請(qǐng)輸入已累計(jì)投入總額', type: 'number', trigger: 'blur' }]
      },
      // 提交狀態(tài)
      loading: false,
      headers: {
        Authorization: getToken()
      },
      // 是否是修改
      isUpdate: false
    };
  },

到此這篇關(guān)于Vue3+antDesignVue實(shí)現(xiàn)表單校驗(yàn)的方法的文章就介紹到這了,更多相關(guān)Vue3 antDesignVue表單校驗(yàn)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • vue proxyTable的跨域中pathRewrite配置方式

    vue proxyTable的跨域中pathRewrite配置方式

    這篇文章主要介紹了vue proxyTable的跨域中pathRewrite配置方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-04-04
  • vue 指定文字高亮的實(shí)現(xiàn)示例

    vue 指定文字高亮的實(shí)現(xiàn)示例

    在做文字處理的項(xiàng)目時(shí)經(jīng)常會(huì)遇到搜索文字并高亮的需求,本文就來(lái)介紹vue 指定文字高亮的實(shí)現(xiàn)示例,具有一定的參考價(jià)值,感興趣的可以了解一下
    2023-12-12
  • 深入探討如何在Vue中使用EventBus實(shí)現(xiàn)組件間的高效通信

    深入探討如何在Vue中使用EventBus實(shí)現(xiàn)組件間的高效通信

    在現(xiàn)代前端開(kāi)發(fā)中,Vue.js?作為一種流行的漸進(jìn)式框架,廣泛應(yīng)用于各類?Web?項(xiàng)目的構(gòu)建中,本文將深入探討如何在?Vue?中使用?EventBus,實(shí)現(xiàn)組件間的高效通信,需要的可以了解下
    2024-11-11
  • vite?vue3?規(guī)范化與Git?Hooks詳解

    vite?vue3?規(guī)范化與Git?Hooks詳解

    這篇文章主要介紹了vite?vue3?規(guī)范化與Git?Hooks,本文重點(diǎn)討論?git?提交規(guī)范,結(jié)合示例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-10-10
  • 基于Vue?+?Node.js自動(dòng)發(fā)布服務(wù)腳本的完整流程

    基于Vue?+?Node.js自動(dòng)發(fā)布服務(wù)腳本的完整流程

    在當(dāng)今快節(jié)奏的軟件開(kāi)發(fā)環(huán)境中,前端項(xiàng)目的快速迭代與高效部署成為了提升競(jìng)爭(zhēng)力的關(guān)鍵,這篇文章主要介紹了基于Vue+Node.js自動(dòng)發(fā)布服務(wù)腳本的完整流程,需要的朋友可以參考下
    2026-03-03
  • Vue自定義指令的使用詳細(xì)介紹

    Vue自定義指令的使用詳細(xì)介紹

    我們看到的v-開(kāi)頭的行內(nèi)屬性,都是指令,不同的指令可以完成或?qū)崿F(xiàn)不同的功能,對(duì)普通 DOM元素進(jìn)行底層操作,這時(shí)候就會(huì)用到自定義指令。除了核心功能默認(rèn)內(nèi)置的指令 (v-model 和 v-show),Vue 也允許注冊(cè)自定義指令
    2022-09-09
  • Vue版本演進(jìn)之Vue3、Vue2.7與Vue2全面詳細(xì)對(duì)比

    Vue版本演進(jìn)之Vue3、Vue2.7與Vue2全面詳細(xì)對(duì)比

    隨著前端技術(shù)的不斷發(fā)展,各種框架應(yīng)運(yùn)而生,而Vue.js憑借其簡(jiǎn)潔、靈活的特性,成為了許多開(kāi)發(fā)者的首選,這篇文章主要介紹了Vue版本演進(jìn)之Vue3、Vue2.7與Vue2全面詳細(xì)對(duì)比的相關(guān)資料,需要的朋友可以參考下
    2026-03-03
  • vue中el-tree動(dòng)態(tài)初始默認(rèn)選中和全選實(shí)現(xiàn)方法

    vue中el-tree動(dòng)態(tài)初始默認(rèn)選中和全選實(shí)現(xiàn)方法

    這篇文章主要給大家介紹了關(guān)于vue中el-tree動(dòng)態(tài)初始默認(rèn)選中和全選實(shí)現(xiàn)的相關(guān)資料,eltree默認(rèn)選中eltree是一種常用的樹(shù)形控件,通常用于在網(wǎng)頁(yè)上呈現(xiàn)樹(shù)形結(jié)構(gòu)的數(shù)據(jù),例如文件夾、目錄、組織結(jié)構(gòu)等,需要的朋友可以參考下
    2023-09-09
  • Vue中防抖與節(jié)流實(shí)現(xiàn)方法詳解

    Vue中防抖與節(jié)流實(shí)現(xiàn)方法詳解

    防抖、節(jié)流是為了在某個(gè)事件頻繁發(fā)生時(shí),不把這個(gè)頻繁的事件內(nèi)的操作也這么頻繁的觸發(fā),這篇文章主要介紹了Vue中防抖與節(jié)流實(shí)現(xiàn)方法的相關(guān)資料,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2026-03-03
  • vue3中引入class類的寫(xiě)法代碼示例

    vue3中引入class類的寫(xiě)法代碼示例

    最近一直在做vue項(xiàng)目,從網(wǎng)上搜索到的資料不太多,這篇文章主要給大家介紹了關(guān)于vue3中引入class類的寫(xiě)法的相關(guān)資料,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2024-05-05

最新評(píng)論

洛隆县| 金寨县| 鄂州市| 博客| 报价| 松江区| 丹阳市| 无锡市| 乌兰浩特市| 台中市| 虹口区| 铁力市| 中阳县| 岗巴县| 金堂县| 杭州市| 台湾省| 湘潭县| 杭锦后旗| 奉化市| 喜德县| 东海县| 西充县| 胶南市| 建德市| 天津市| 德兴市| 新民市| 东山县| 简阳市| 宕昌县| 四平市| 武平县| 上杭县| 万盛区| 金平| 怀仁县| 杨浦区| 辽源市| 兴和县| 东乡|