| 12345678910111213141516171819202122232425262728293031323334353637 |
- let app = new Vue({
- el: '#app',
- data () {
- return {
- accounts:'',
- password:'',
- userList:[
- {accounts:'123',password:'456'},
- {accounts:'admin',password:'123456'}
- ]
- }
- },
- created () {
- },
- beforeDestroy () {
- },
- mounted () {
- },
- methods: {
- goIndex(){
- console.log(this.accounts,this.password)
- for(let a = 0;a<this.userList.length;a++){
- if(this.userList[a].accounts == this.accounts){
- if(this.userList[a].password == this.password){
- this.$message({
- message: '登录成功',
- type: 'success'
- });
- return
- }
- }
- }
- this.$message.error('用户名不存在或密码错误');
- }
- },
- })
|