[英]Vue.js app is run on http://localhost:8080, whenever I make a GET request using axios to my back-end API, the localhost gets prepended to the URL
[英]Why do I get '?' in the url 'http://localhost/BackBoneWorkspace/helloDemoMVC/?#login' in backbone js app
我正在使用bone.js。
我有一个登录表单,并处理了登录视图事件中的提交行为。
我所做的是当用户输入电子邮件和密码时,我已经在详细信息视图中显示了它,但是我的问题是得到了?
当我单击登录按钮时,URL中的字符...
有人知道吗,请帮忙。
这是我在login.js中的事件处理代码
events:{
'submit form' : 'detailsPage'
},
detailsPage: function(){
console.log("submit event fired");
myApp.usermodel.set({"userName":$("#email").val(),"password":$("#password").val()});
myApp.collection.add(myApp.usermodel);
myApp.usermodel.save();
myApp.details= new myApp.DetailsView();
myApp.details.render(myApp.usermodel.get("userName"), myApp.usermodel.get("password"));
}
在detailsPage
函数中,您需要通过调用event.preventDefault()
函数来阻止表单实际提交。 该event
对象将作为第一个参数传递到detailsPage
。
detailsPage: function (event) {
event.preventDefault();
// ...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.