54 lines
1.0 KiB
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> |