123
This commit is contained in:
+13
-8
@@ -9,6 +9,9 @@
|
||||
|
||||
<script>
|
||||
import { tabbar } from '../src/router'
|
||||
import { getWechatSign } from './api'
|
||||
import { signToWechat } from './common/wechat-web';
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
data(){
|
||||
@@ -21,22 +24,24 @@ export default {
|
||||
provide(){
|
||||
return {
|
||||
root: this,
|
||||
tabbar: this.$refs.tabbar
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showTabbar(){
|
||||
const path = tabbar.map(tab => tab.path);
|
||||
return path.includes(this.$route.path)
|
||||
tabbar: this.$refs.tabbar,
|
||||
showTabbar: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
},
|
||||
beforeCreate: () => {
|
||||
getWechatSign(location.href).then(res => {
|
||||
signToWechat(res)
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
'$route': {
|
||||
immediate: true,
|
||||
handler(to){
|
||||
const path = tabbar.map(tab => tab.path);
|
||||
document.title = to.meta.title || '自在福田';
|
||||
this.showTabbar = path.includes(path)
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -52,7 +57,7 @@ export default {
|
||||
|
||||
<style>
|
||||
@import '~@/assets/css/reset.css';
|
||||
@import '//at.alicdn.com/t/font_2897403_zb1glrkwpij.css';
|
||||
@import '//at.alicdn.com/t/font_2897403_4wpxnjzf9qy.css';
|
||||
|
||||
#app {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
|
||||
Reference in New Issue
Block a user