Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
75038782
Commit
75038782
authored
Jun 06, 2025
by
王炽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
666666
parent
dc41bb18
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
128 additions
and
1 deletion
+128
-1
TabBarConLibrary.vue
components/TabBarConLibrary.vue
+106
-1
.DS_Store
static/contentLibrary/.DS_Store
+0
-0
ContentLibrary.vue
views/ContentLibrary.vue
+22
-0
No files found.
components/TabBarConLibrary.vue
View file @
75038782
<
template
>
<
template
>
<view
class=
"custom-tab-bar"
>
<view
v-for=
"(tab, index) in tabs"
:key=
"index"
class=
"tab-item"
:class=
"
{ active: activeIndex === index }"
@click="handleTabClick(index)"
>
<image
class=
"tab-bg"
:src=
"activeIndex === index ? '/static/integral/tab-bg-cl0.png' : '/static/integral/tab-bg-cl1.png'"
mode=
"aspectFit"
/>
<text
class=
"tab-text"
:class=
"
{ active: activeIndex === index }"
>
{{
tab
.
text
}}
</text>
</view>
</view>
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
ref
}
from
'vue'
// Props 定义
const
props
=
defineProps
({
defaultActive
:
{
type
:
Number
,
default
:
0
}
})
// Events 定义
const
emit
=
defineEmits
([
'tabChange'
])
// 响应式数据
const
activeIndex
=
ref
(
props
.
defaultActive
)
// Tab 配置数据
const
tabs
=
ref
([
{
text
:
'疾病护理'
},
{
text
:
'脑育科普'
},
{
text
:
'孕期护理'
}
])
// 点击处理
const
handleTabClick
=
(
index
)
=>
{
if
(
activeIndex
.
value
===
index
)
return
activeIndex
.
value
=
index
emit
(
'tabChange'
,
{
index
,
tab
:
tabs
.
value
[
index
]
})
}
// 暴露方法供父组件调用
defineExpose
({
setActiveIndex
:
(
index
)
=>
{
if
(
index
>=
0
&&
index
<
tabs
.
value
.
length
)
{
activeIndex
.
value
=
index
}
}
})
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
@import '@/common.less';
.custom-tab-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
.tab-item {
position: relative;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
height: 80rpx;
margin: 0 10rpx;
.tab-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.tab-text {
position: relative;
z-index: 2;
font-size: 28rpx;
font-weight: 500;
color: #1d1e25;
transition: color 0.3s ease;
&.active {
color: #ffffff;
}
}
// 点击效果
&:active {
opacity: 0.8;
}
}
}
</
style
>
</
style
>
\ No newline at end of file
static/contentLibrary/.DS_Store
View file @
75038782
No preview for this file type
views/ContentLibrary.vue
0 → 100644
View file @
75038782
<
template
>
<view
class=
"con-library-container"
>
<view
class=
"content"
>
<!-- 首页内容 -->
<text>
66666666
</text>
</view>
</view>
</
template
>
<
script
setup
>
// 首页组件逻辑
</
script
>
<
style
lang=
"less"
scoped
>
.con-library-container {
padding: 20rpx;
.content {
padding-bottom: 100rpx;
}
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment