work_order/pages/test/test.vue

54 lines
1.0 KiB
Vue

<template>
<view>
<!-- <button type="primary" @click="open">开始定位(已获取{{count}})</button>
<button type="primary" @click="close">停止定位</button>
<view v-for="(item, index) in list" :key="index" :class="item.type==0?'green': 'red'">
<view>{{item.a}}</view>
<view style="color: #333;">{{item.b}}</view>
</view> -->
<button type="primary" @click="logout">退出登录</button>
</view>
</template>
<script>
export default {
data() {
return {
list: [],
count: 0
}
},
onLoad() {
console.log(this.userInfo);
},
computed: {
userInfo(){
return this.$store.state.app.userInfo;
}
},
methods: {
open() {
},
close() {
},
logout() {
this.$store.commit('LOGOUT');
uni.redirectTo({
url: '/pages/login/login'
})
}
}
}
</script>
<style lang="scss">
.green {
color: green;
}
.red {
color: red;
}
</style>