opentiny / tiny-vue

TinyVue is an enterprise-class UI component library of OpenTiny community, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.
https://opentiny.design/tiny-vue
MIT License
1.53k stars 251 forks source link

🐛 [Bug]: form表单的属性size在不为默认下,校验提示类型为text的提示显示不全 #1750

Closed Lymanli closed 1 month ago

Lymanli commented 1 month ago

Version

3.16

Vue Version

3.4.27

Link to minimal reproduction

https://opentiny.design/vue-playground?cmpId=form&fileName=validate-type.vue&apiMode=Options&mode=pc&theme=default

<template>
  <div class="demo-form-valid-text">
    <div class="mb-12">表单尺寸: <tiny-button-group :data="sizeList" v-model="sizeValue"></tiny-button-group></div>
    <div class="title">
      <div>提示形式:<tiny-button-group :data="validTypeList" v-model="validType"></tiny-button-group></div>
    </div>
    <tiny-form ref="ruleFormRef" :model="createData" :rules="rules" :validate-type="validType" :size="sizeValue">
      <tiny-form-item label="必填" prop="users">
        <tiny-input v-model="createData.users"></tiny-input>
      </tiny-form-item>
      <tiny-form-item label="日期" prop="datepicker">
        <tiny-date-picker v-model="createData.datepicker"></tiny-date-picker>
      </tiny-form-item>
      <tiny-form-item label="邮件" prop="email" :validate-type="validType">
        <tiny-input v-model="createData.email"></tiny-input>
      </tiny-form-item>
      <tiny-form-item>
        <tiny-button type="primary" @click="handleSubmit"> 提交 </tiny-button>
      </tiny-form-item>
    </tiny-form>
  </div>
</template>

<script>
import { Form, FormItem, Input, DatePicker, Button, ButtonGroup } from '@opentiny/vue'

export default {
  components: {
    TinyForm: Form,
    TinyFormItem: FormItem,
    TinyInput: Input,
    TinyDatePicker: DatePicker,
    TinyButton: Button,
    TinyButtonGroup: ButtonGroup
  },
  data() {
    return {
      sizeList:[
        { text: 'null', value: null },
        { text: 'medium', value: 'medium' },
        { text: 'small', value: 'small' },
        { text: 'mini', value: 'mini' }
      ],
      sizeValue: null,
      createData: {
        users: '',
        email: '',
        datepicker: ''
      },
      validType: 'text',
      validTypeList: [
        { text: 'tip', value: 'tip' },
        { text: 'text', value: 'text' }
      ],
      rules: {
        users: { required: true, message: '必填', trigger: 'blur' },
        datepicker: { required: true, type: 'date' },
        email: { required: true, type: 'email' }
      }
    }
  },
  methods: {
    handleSubmit() {
      this.$refs.ruleFormRef.validate((valid) => {})
    }
  }
}
</script>

<style scoped>
.demo-form-valid-text {
  width: 380px;
}

.title {
  margin-bottom: 16px;
  font-size: 14px;
}
</style>

Step to reproduce

What is expected

form表单的size尺寸为非默认值时,表单下的必填提示能完整显示,没有遮挡

What is actually happening

form表单的size尺寸为非默认值时,表单下的必填提示被遮挡,不能完整显示

image image image

What is your project name

form表单

Any additional comments (optional)

No response

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛 [Bug]: When the form attribute size is not the default, the verification prompt type is text and the prompt is not fully displayed.

gimmyhehe commented 1 month ago

@Lymanli 问题已收录,修复后将于3.18.0版本发布~

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


@Lymanli The problem has been included and will be released in version 3.18.0 after repair~