Solve the problem of the front-end vue project: element avoids the carriage return triggered twice to refresh the page

When entering, the element will trigger the unnecessary carriage return to refresh the page twice, and you need to add a blocking event

 Add @submit.prevent in el-form to prevent the event

<el-form
      ref="Form"
      :model="form"
      class="form"
      @submit.prevent
    >
      <el-form-item label="名称" prop="name">
        <el-input
          v-model="form.name"
          placeholder="请输入名称"
          clearable
          v-focus
          @keyup.enter.native="search"
        />
      </el-form-item>
    </el-form>

The author's previous article,

Solve the front-end project scene problem: vue+element progress bar el-progress renders back-end dynamic data_Yichu's blog-CSDN blog vue+element progress bar el-progress renders back-end dynamic data. percentage: percentage format: add a : (colon) in front of the specified text content, and perform a callback function. Pass data to el-progress progress bar https://blog.csdn.net/weixin_43928112/article/details/126613981

Guess you like

Origin blog.csdn.net/weixin_43928112/article/details/126787114