测试

parent 8c0cf65f
<template> <template>
<router-view v-slot="{ Component, route }">
<keep-alive>
<component :is="Component" :key="route.meta.usePathKey ? route.path : undefined" />
</keep-alive>
</router-view>
<van-tabbar v-model="active" :placeholder="true" active-color="#0E7CE3" route> <!-- #ifdef MP-WEIXIN -->
<van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item> <view class="container">微信小程序环境</view>
<van-tabbar-item icon="apps-o" to="/prefecture">专区</van-tabbar-item> <!-- #endif -->
<van-tabbar-item icon="send-gift-o" to="/subject">专题</van-tabbar-item> <!-- #ifdef H5 -->
<van-tabbar-item icon="user-o" to="/mine">我的</van-tabbar-item> <view class="container">H5环境</view>
</van-tabbar> <!-- #endif -->
<!-- #ifdef APP -->
<view class="container">APP环境</view>
<!-- #endif -->
<van-tabbar v-model="active" :placeholder="true" active-color="#0E7CE3" route>
<van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item>
<van-tabbar-item icon="apps-o" to="/prefecture">专区</van-tabbar-item>
<van-tabbar-item icon="send-gift-o" to="/subject">专题</van-tabbar-item>
<van-tabbar-item icon="user-o" to="/mine">我的</van-tabbar-item>
</van-tabbar>
</template> </template>
<script setup> <script setup>
import { ref } from 'vue' import {
const active = ref('/home') ref
} from 'vue'
const active = ref('/home')
// #ifdef H5 // #ifdef H5
console.log('当前环境为H5') // 这里可以编写H5环境的代码逻辑 console.log('当前环境为H5') // 这里可以编写H5环境的代码逻辑
// #endif // #endif
// #ifdef APP // #ifdef APP
console.log('当前环境为APP') // 这里可以编写APP环境的代码逻辑 console.log('当前环境为APP') // 这里可以编写APP环境的代码逻辑
// #endif // #endif
</script> </script>
<style scoped></style> <style scoped></style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment