You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1006 B
55 lines
1006 B
<template>
|
|
<view class="container">
|
|
<view class="content">
|
|
<home v-if="navIndex === 0" />
|
|
<mine v-else />
|
|
</view>
|
|
<nav-bottom @change="onNavChange" @scan="onScan" class="nav-bottom"></nav-bottom>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import Home from './components/home.vue';
|
|
import Mine from './components/mine.vue';
|
|
|
|
export default {
|
|
components: { Home, Mine },
|
|
data() {
|
|
return {
|
|
navIndex: 0,
|
|
};
|
|
},
|
|
onLoad() {},
|
|
methods: {
|
|
/**
|
|
* 监听nav-bottom的点击事件
|
|
* @param {number} index nav-bottom按钮的索引值
|
|
*/
|
|
onNavChange(index) {
|
|
this.navIndex = index;
|
|
},
|
|
|
|
// 扫一扫
|
|
onScan() {
|
|
console.log('扫一扫');
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
width: 100%;
|
|
height: 100vh;
|
|
|
|
.content {
|
|
flex: 1;
|
|
}
|
|
.nav-bottom {
|
|
width: 100%;
|
|
}
|
|
}
|
|
</style>
|
|
|