element-ui Enter the search box on the page to refresh the solution to the problem

Use ElementUI development process, found that the use of the search text box, then when editing cursor in the search box, click the Enter key cause problems refresh the page, you can solve by adding @ submit.native.prevent properties in el-form tags.

<el-from @submit.native.prevent>
  <el-input>
    <el-button></el-button>
  </el-input>
</el-from>

When using the search box development should pay attention to add this attribute on it, the original HTML solutions and solutions are the same, are blocked automatically refresh the form characteristic of form after form button click.

 

"Happiness is a long night to accompany someone to talk to you, night lights immortal someone waiting for you to come home."

Guess you like

Origin www.cnblogs.com/yanggb/p/12360399.html