文件
OmniCard/mpuniapp/pages/uni-ui/tab-bar/tab-content2.uvue

41 行
782 B
Plaintext

<template>
<view class="content-page">
<text class="page-title">消息</text>
<text class="page-text">这是消息页的内容</text>
<text class="page-text">当前索引: {{ activeIndex }}</text>
</view>
</template>
<script setup lang="uts">
import { inject, ref } from 'vue'
import { Ref } from 'vue'
// 从父组件注入当前激活的索引
const activeIndex = inject<Ref<number>>('uniTabBarCurrentIndex', ref(0))
</script>
<style>
.content-page {
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
padding: 20px;
background-color: #fff5f5;
}
.page-title {
font-size: 28px;
font-weight: bold;
color: #333;
margin-bottom: 20px;
}
.page-text {
font-size: 16px;
color: #666;
margin-bottom: 10px;
}
</style>