Cannot find element: #user
xsmbqzj opened this issue · 0 comments
xsmbqzj commented
js代码明明在岁后面还是报找不到这个错
<script> import Vue from 'vue' var user=new Vue({ el : '#user', data : { username : '', userpwd : '', }, methods:{ login(){ var username=this.username; var userpwd=this.userpwd; if(username==""||userpwd==""){ this.$message({ message : '账号或密码为空!', type : 'error' }) return; }else if(username!="admin"||userpwd!="123456"){ this.$message({ message : '账号或密码错误!', type : 'error' }) return; }else{ this.$message({ message : '登陆成功!', }) $router.login('/10086'); } } } }) </script>