Cannot set FormItem as Modal footer, when iview Form and Modal are used at the same time. Form validation cannot be performed.

write a route management page, click add Route pop-up modal, to fill out the form and verify it automatically.
but the button cannot be rendered correctly with < div slot= "footer" > .

Code:

html fragment:

<Modal v-model="addRouteModal" title="">
        <Form ref="newRouteInModal" :model="newRouteInModal" :rules="routeValidate" label-position="left" :label-width="100">
            <FormItem prop="target" label="IP">
                <Input v-model="newRouteInModal.target" :autofocus="true"></Input>
            </FormItem>
            <FormItem prop="genmask" label="">
                <Input v-model="newRouteInModal.genmask"></Input>
            </FormItem>
            <FormItem prop="gateway" label="">
                <Input v-model="newRouteInModal.gateway"></Input>
            </FormItem>

            <div slot="footer">
                <FormItem>
                    <Button type="primary" @click="addRouteModalOnOk("newRouteInModal")"></Button>
                    <Button type="ghost" @click="handleReset("newRouteInModal")"></Button>
                </FormItem>
            </div>

        </Form>
    </Modal>

js fragment:

handleReset(name) {
    this.$refs[name].resetFields();
},

addRouteModalOnOk(name) {
    this.$refs[name].validate((valid) => {
        if (valid) {
            this.$Message.success("Success!");
        } else {
            this.$Message.error("Fail!");
        }
    });
},

if you use the modal native button, the < FormItem > attribute will be lost, and the this.$ refs [name] .validate will be invalidated.

is there any way to use form"s form validation feature in modal?

Mar.03,2021

    <Modal
      v-model="updataVisible"
      :mask-closable="false"
      :styles="{top: '16%'}"
      width="800"
      @on-visible-change="beforeClose">
      <div slot="header" class="font-16 font-w900">
        {{updataTitle}}
      </div>
      <Form ref="ruleFormValidate" :model="updataObj" :rules="ruleValidate" :label-width="120" label-position="left">
        </FormItem>
        <!---->
        <FormItem label="Rule Type" prop="ruleType" class="width-80">
          <Select size="large" v-model="updataObj.ruleType" placeholder="Please Select Rule Type" clearable filterable>
            <Option v-for="item in controlRuleTypeList" :value="item.ruleType" :key="item.ruleType">{{ item.value }}</Option>
          </Select>
        </FormItem>
      </Form>
      <div slot="footer">
        <Button type="primary" size="large" @click="submitForm('ruleFormValidate')">Submit</Button>
        <Button type="ghost" size="large" @click="cancleSubmit('ruleFormValidate')" style="margin-left: 8px">Cancle</Button>
      </div>
      <!---->
      <Spin fix v-if="subLoading">
        <Icon type="load-c" size=30 class="demo-spin-icon-load"></Icon>
        <div>Submitting...</div>
      </Spin>
    </Modal>

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bdd6c8-53fd7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bdd6c8-53fd7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?