加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

通过vue router-link 点击事件请求

发布时间:2020-12-15 07:48:03 所属栏目:Java 来源:网络整理
导读:??????????????span用户登陆/span ???????????/div ???????????form?action="https://api.it120.cc/small4/user/m/login?deviceId=007deviceName=monkey"????method="post" ????账户:?input?type="text"?name="mobile" ????密码:?input?type="password"?name
??????????????<span>用户登陆</span>
???????????</div>
???????????<form?action="https://api.it120.cc/small4/user/m/login?deviceId=007&deviceName=monkey"????method="post">
????账户:?<input?type="text"?name="mobile">
????密码:?<input?type="password"?name="pwd">
????<!--?<input?type="submit"?@click="logo()">?-->
????<router-link??@click.native="logo"?to="">提交</router-link>
</form>
????????</template>
记住router-link点击触发事件必须写? native否则触发不了
然后在methods:{? ?添加
logo(){
????????????console.log(123456)
???
??????axios({
???????????methods:"post",
????????????url:?‘https://api.it120.cc/small4/user/m/login?deviceId=007&deviceName=monkey‘,
?????????????params:{
??????????????????mobile:13500000000,
??????????????????pwd:12345
??????????????}
??????}).then(res=>console.log(res))
}
? ? ? 接着触发? ? ?就会获取到相对应的参数了

?

?仅供参考。谢谢。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读