Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
Project
Project
Details
Activity
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lihuizhen
ec-report-refactor
Commits
17888a7c
Commit
17888a7c
authored
Dec 15, 2022
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: preview image use swiper current index
parent
5c929cbf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
ModelData.vue
components/ModelData/ModelData.vue
+17
-7
No files found.
components/ModelData/ModelData.vue
View file @
17888a7c
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
class=
"swiper"
class=
"swiper"
circular
circular
:current=
"currentIndex"
:current=
"currentIndex"
@
change=
"changed"
:style=
"
{ height: `${height}px` }"
:style=
"
{ height: `${height}px` }"
>
>
<swiper-item
v-for=
"(item, index) in popupData"
:key=
"index"
>
<swiper-item
v-for=
"(item, index) in popupData"
:key=
"index"
>
...
@@ -39,7 +40,9 @@
...
@@ -39,7 +40,9 @@
export
default
{
export
default
{
name
:
'ModelData'
,
name
:
'ModelData'
,
data
()
{
data
()
{
return
{}
return
{
swiperIndex
:
-
1
}
},
},
props
:
{
props
:
{
popupData
:
{
popupData
:
{
...
@@ -79,14 +82,21 @@ export default {
...
@@ -79,14 +82,21 @@ export default {
methods
:
{
methods
:
{
close
()
{
close
()
{
this
.
swiperIndex
=
-
1
this
.
$emit
(
'close'
)
this
.
$emit
(
'close'
)
},
},
seeImage
(
key
)
{
seeImage
(
key
)
{
if
(
this
.
swiperIndex
===
-
1
)
{
this
.
swiperIndex
=
this
.
currentIndex
}
const
images
=
this
.
popupData
.
map
(
item
=>
item
[
key
])
const
images
=
this
.
popupData
.
map
(
item
=>
item
[
key
])
uni
.
previewImage
({
uni
.
previewImage
({
current
:
this
.
current
Index
,
current
:
this
.
swiper
Index
,
urls
:
images
urls
:
images
})
})
},
changed
(
event
)
{
this
.
swiperIndex
=
event
.
detail
.
current
}
}
}
}
}
}
...
...
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