Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 90115526
authored
Apr 10, 2024
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit 修复
1 parent
72496606
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
16 deletions
pages/detail/components/Tabs.vue
pages/detail/detail.vue
pages/detail/components/Tabs.vue
View file @
9011552
...
...
@@ -3,14 +3,17 @@
<template
v-for=
"(item,index) in list"
>
<view
:class=
"['tab',
{active:index == tabIndex}]"
:
ref
="`tab-${index}`"
:
id
="`tab-${index}`"
:key="index"
@click="tabClick(index)"
>
{{
item
.
tabName
}}
</view>
</
template
>
<view
class=
"border"
:style=
"borderLeft"
></view>
<view
class=
"border"
:style=
"borderLeft"
></view>
</view>
</template>
...
...
@@ -18,16 +21,18 @@
export
default
{
name
:
'Tabs'
,
props
:
{
list
:
Array
list
:
Array
,
},
data
()
{
return
{
tabIndex
:
0
,
borderLeft
:
'display: none;'
borderLeft
:
'display: none;'
,
}
},
mounted
()
{
this
.
setBorderLeft
()
setTimeout
(()
=>
{
this
.
setBorderLeft
()
},
300
)
},
methods
:
{
tabClick
(
index
)
{
...
...
@@ -35,12 +40,19 @@ export default {
this
.
$emit
(
'tabclick'
,
index
)
this
.
setBorderLeft
()
},
setBorderLeft
(){
let
{
tabIndex
}
=
this
this
.
borderLeft
=
`left:
${
this
.
$refs
[
`tab-
${
tabIndex
}
`
][
0
].
$el
.
offsetLeft
}
px;`
setTimeout
(()
=>
{
this
.
borderLeft
+=
`display:block;`
},
100
)
setBorderLeft
()
{
let
{
tabIndex
}
=
this
const
query
=
uni
.
createSelectorQuery
().
in
(
this
)
query
.
select
(
`#tab-
${
tabIndex
}
`
)
.
boundingClientRect
((
data
)
=>
{
console
.
log
(
data
)
this
.
borderLeft
=
`left:
${
data
.
left
}
px;`
setTimeout
(()
=>
{
this
.
borderLeft
+=
`display:block;`
},
100
)
}).
exec
()
}
}
}
...
...
@@ -72,7 +84,7 @@ export default {
font-weight
:
500
;
color
:
#292d33
;
}
.border
{
.border
{
width
:
384
rpx
;
height
:
80
rpx
;
border
:
4
rpx
solid
#292d33
;
...
...
@@ -80,8 +92,8 @@ export default {
position
:
absolute
;
left
:
0
;
top
:
0
;
transition
:
all
.15s
;
transition
:
all
0.15s
;
z-index
:
3
;
}
}
</
style
>
\ No newline at end of file
pages/detail/detail.vue
View file @
9011552
...
...
@@ -175,7 +175,6 @@ export default {
width
:
100%
;
height
:
100%
;
z-index
:
-1
;
opacity
:
0
;
left
:
0
;
top
:
0
;
display
:
none
;
...
...
@@ -183,7 +182,7 @@ export default {
.showView
{
z-index
:
2
;
display
:
block
;
animation
:
show-view
0.25s
forwards
;
animation
:
show-view
0.25s
;
}
.pen-box
{
position
:
fixed
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment