123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <template>
- <uvForm
- ref="uForm"
- :model="model"
- :rules="rules"
- :errorType="errorType"
- :borderBottom="borderBottom"
- :labelPosition="labelPosition"
- :labelWidth="labelWidth"
- :labelAlign="labelAlign"
- :labelStyle="labelStyle"
- :customStyle="customStyle"
- >
- <slot />
- </uvForm>
- </template>
- <script>
-
- import uvForm from '../u-form/u-form.vue';
- import props from '../u-form/props.js'
- export default {
-
- name: 'u-form',
-
-
- name: 'u--form',
-
- mixins: [uni.$u.mpMixin, props, uni.$u.mixin],
- components: {
- uvForm
- },
- created() {
- this.children = []
- },
- methods: {
-
- setRules(rules) {
- this.$refs.uForm.setRules(rules)
- },
- validate() {
-
-
- this.setMpData()
-
- return this.$refs.uForm.validate()
- },
- validateField(value, callback) {
-
- this.setMpData()
-
- return this.$refs.uForm.validateField(value, callback)
- },
- resetFields() {
-
- this.setMpData()
-
- return this.$refs.uForm.resetFields()
- },
- clearValidate(props) {
-
- this.setMpData()
-
- return this.$refs.uForm.clearValidate(props)
- },
- setMpData() {
- this.$refs.uForm.children = this.children
- }
- },
- }
- </script>
|