login.vue
1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<template>
<div class="login-wrapper">
<img :src="logo" width="50" height="50" style="border-radius: 5px;margin-bottom:12px;"/>
<el-select v-model="userID">
<el-option v-for="index in 30" :key="index" :label="`user${index-1}`" :value="`user${index-1}`"></el-option>
</el-select>
<br>
<el-button type="primary" @click="login" style="width:100%;">登录</el-button>
</div>
</template>
<script>
import { Select, Option } from 'element-ui'
import logo from '../../assets/image/logo.png'
export default {
name: 'Login',
components: {
ElSelect: Select,
ElOption: Option
},
data() {
return {
userID: 'user0',
logo: logo
}
},
methods: {
login() {
this.$store.dispatch('login', this.userID)
}
}
}
</script>
<style lang="stylus" scoped>
.login-wrapper {
display: flex;
align-items: center;
flex-direction: column;
padding: 24px;
background: $white;
color: $black;
border-radius: 5px;
box-shadow: 0 11px 20px 0 rgba(0, 0, 0, .3);
}
</style>