mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-23 09:29:50 +08:00
fix(form/base): fix form base validate (#48)
* fix(form/base): fix form base validate * chore(form/base): optimize form/base dom * chore(form/base): remove console
This commit is contained in:
parent
8bea964e9f
commit
9ad352d9ac
|
@ -21,7 +21,7 @@
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"qrcode.vue": "^3.2.2",
|
"qrcode.vue": "^3.2.2",
|
||||||
"tdesign-icons-vue-next": "^0.0.6",
|
"tdesign-icons-vue-next": "^0.0.6",
|
||||||
"tdesign-vue-next": "0.6.4",
|
"tdesign-vue-next": "0.7.0-alpha.0",
|
||||||
"tvision-color": "^1.3.1",
|
"tvision-color": "^1.3.1",
|
||||||
"vue": "^3.1.5",
|
"vue": "^3.1.5",
|
||||||
"vue-color-kit": "^1.0.5",
|
"vue-color-kit": "^1.0.5",
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
|
||||||
<div class="form-basic-container">
|
|
||||||
<div class="form-basic-item">
|
|
||||||
<div class="form-basic-container-title">合同信息</div>
|
|
||||||
<!-- 表单内容 -->
|
|
||||||
<t-form
|
<t-form
|
||||||
ref="form"
|
ref="form"
|
||||||
class="base-form"
|
class="base-form"
|
||||||
|
@ -14,6 +9,11 @@
|
||||||
@reset="onReset"
|
@reset="onReset"
|
||||||
@submit="onSubmit"
|
@submit="onSubmit"
|
||||||
>
|
>
|
||||||
|
<div class="form-basic-container">
|
||||||
|
<div class="form-basic-item">
|
||||||
|
<div class="form-basic-container-title">合同信息</div>
|
||||||
|
<!-- 表单内容 -->
|
||||||
|
|
||||||
<!-- 合同名称,合同类型 -->
|
<!-- 合同名称,合同类型 -->
|
||||||
<t-row class="row-gap" :gutter="[16, 24]">
|
<t-row class="row-gap" :gutter="[16, 24]">
|
||||||
<t-col :span="6">
|
<t-col :span="6">
|
||||||
|
@ -58,12 +58,7 @@
|
||||||
placeholder="请选择类型"
|
placeholder="请选择类型"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<t-option
|
<t-option v-for="(item, index) in PARTY_A_OPTIONS" :key="index" :value="item.value" :label="item.label">
|
||||||
v-for="(item, index) in PARTY_A_OPTIONS"
|
|
||||||
:key="index"
|
|
||||||
:value="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
>
|
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</t-option>
|
</t-option>
|
||||||
</t-select>
|
</t-select>
|
||||||
|
@ -78,12 +73,7 @@
|
||||||
class="demo-select-base"
|
class="demo-select-base"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<t-option
|
<t-option v-for="(item, index) in PARTY_B_OPTIONS" :key="index" :value="item.value" :label="item.label">
|
||||||
v-for="(item, index) in PARTY_B_OPTIONS"
|
|
||||||
:key="index"
|
|
||||||
:value="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
>
|
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</t-option>
|
</t-option>
|
||||||
</t-select>
|
</t-select>
|
||||||
|
@ -138,19 +128,9 @@
|
||||||
</t-form-item>
|
</t-form-item>
|
||||||
</t-col>
|
</t-col>
|
||||||
</t-row>
|
</t-row>
|
||||||
</t-form>
|
|
||||||
|
|
||||||
<div class="form-basic-container-title form-title-gap">其它信息</div>
|
<div class="form-basic-container-title form-title-gap">其它信息</div>
|
||||||
<t-form
|
|
||||||
ref="form"
|
|
||||||
class="base-form"
|
|
||||||
:data="formData"
|
|
||||||
:rules="FORM_RULES"
|
|
||||||
label-align="top"
|
|
||||||
:label-width="100"
|
|
||||||
@reset="onReset"
|
|
||||||
@submit="onSubmit"
|
|
||||||
>
|
|
||||||
<t-form-item label="备注" name="comment">
|
<t-form-item label="备注" name="comment">
|
||||||
<t-textarea v-model="formData.comment" :height="124" placeholder="请输入备注" />
|
<t-textarea v-model="formData.comment" :height="124" placeholder="请输入备注" />
|
||||||
</t-form-item>
|
</t-form-item>
|
||||||
|
@ -161,7 +141,6 @@
|
||||||
<t-avatar>+</t-avatar>
|
<t-avatar>+</t-avatar>
|
||||||
</t-avatar-group>
|
</t-avatar-group>
|
||||||
</t-form-item>
|
</t-form-item>
|
||||||
</t-form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -173,7 +152,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</t-form>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref } from 'vue';
|
import { defineComponent, ref } from 'vue';
|
||||||
|
@ -184,7 +163,6 @@ export default defineComponent({
|
||||||
name: 'FormBase',
|
name: 'FormBase',
|
||||||
setup() {
|
setup() {
|
||||||
const formData = ref({ ...INITIAL_DATA });
|
const formData = ref({ ...INITIAL_DATA });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
TYPE_OPTIONS,
|
TYPE_OPTIONS,
|
||||||
PARTY_A_OPTIONS,
|
PARTY_A_OPTIONS,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user