Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

230
Views
Element resetFields() does not take effect

I used Vue3 with Element Plus to created Form.But The form's resetFields() does not take effect. the form cant auto refresh.


child-component(Edit.vue)

<template>
    <el-dialog title="edit" v-model="modelValue">
      <el-form :model="form" ref="formDate">
      ...
      </el-form>
    </el-dialog>
</template>

parent-component

<template>

<Edit
  v-model:form="form"
  v-model="dialogFormVisible"
  ref="editDialog"
></Edit>

</template>
...
export default {
  components: {
    Edit,
  },
  setup() {
      const state = reactive({
        dialogFormVisible: false,
      })

      const editDialog = ref(null);

      const initForm = () => {
        state.dialogFormVisible = true;

        nextTick(() => {
        console.log(editDialog.value.formDate);
        editDialog.value.formDate.resetFields();
      });

      return {
        ...toRefs(state),
        editDialog,
        initForm,
      };
  }

editDialog.value.formDate was not undefined :enter image description here

But editDialog.value.formDate.resetFields() does not take effect,and it was undefined .

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try to change

editDialog.value.formDate.resetFields()

to

editDialog.value.formDate.value.resetFields()
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!