70 lines
1.5 KiB
Vue
70 lines
1.5 KiB
Vue
<script>
|
|
import {
|
|
mapState
|
|
} from "vuex";
|
|
export default {
|
|
onTabItemClick(itemPath) {
|
|
// 例如,你可以在这里添加一个确认对话框
|
|
console.log("itemPath", itemPath)
|
|
},
|
|
computed: {
|
|
...mapState(["bleValue"]),
|
|
},
|
|
onLaunch: function() {
|
|
console.log('App Launch')
|
|
},
|
|
onShow: function() {
|
|
console.log('App Show')
|
|
},
|
|
onHide: function() {
|
|
console.log('App Hide')
|
|
},
|
|
methods: {
|
|
$createWatcher(name) {
|
|
getApp().globalData.watcher = this.$watch(
|
|
'bleValue',
|
|
val => {
|
|
this[name](val)
|
|
}, {
|
|
deep: true,
|
|
immediate: true
|
|
}
|
|
)
|
|
},
|
|
$removeWatcher() {
|
|
if (getApp().globalData.watcher) {
|
|
getApp().globalData.watcher()
|
|
console.log("watch移除成功")
|
|
} else {
|
|
console.log("没有watch可移除")
|
|
}
|
|
},
|
|
// handleHomeConfig() {
|
|
// let that = this
|
|
// that.$model.getHomeConfig({}).then(res => {
|
|
// if (res.code != 0) return
|
|
// that.$store.commit('changeMenuList', res.data.cook_label)
|
|
// that.$store.commit('changeFoodList', res.data.food_list)
|
|
// })
|
|
// },
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
/* #ifndef APP-NVUE */
|
|
@import "/assets/common.scss";
|
|
@import "/assets/iconfont.css";
|
|
@import "/assets/iconfont-weapp-icon.css";
|
|
|
|
/* #endif*/
|
|
/*每个页面公共css */
|
|
.content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
/* justify-content: center; */
|
|
background-color: #f7f7f7;
|
|
min-height: 100vh;
|
|
}
|
|
</style> |