Vue resolve on the project, click the submit button routing more a question mark

Disclaimer: This article is a blogger original article, please indicate the source. https://blog.csdn.net/qq_42968609/article/details/88367813

Problem Description:

Vue in the project development process, the new parameter table form submitted in the form and found a page refresh, the path more question marks

http://localhost:8100/#/
改变为
http://localhost:8100/?#/

Jump leads routing problems.

the reason:

Here is the form form, click the button button,It triggered his default eventIt is triggered submit this behavior.

solution

Use @ click.prevent prevent the default event

<a-button type="primary" @click.prevent="handleSubmit" :loading="submitLoading">
	确认
</a-button>

Guess you like

Origin blog.csdn.net/qq_42968609/article/details/88367813