Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_admin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_admin
Commits
406c0c09
Commit
406c0c09
authored
Sep 06, 2023
by
yaya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:图片拖拽功能优化
parent
35bfbed2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
src/views/goods/infoSet.vue
src/views/goods/infoSet.vue
+14
-7
No files found.
src/views/goods/infoSet.vue
View file @
406c0c09
...
...
@@ -38,15 +38,19 @@
<Draggable
v-model=
"imageList"
class=
"flex f-fw-w img__wrapper"
handle=
".
gallery
"
handle=
".
item_content
"
anmition=
"500"
delay=
"20"
>
delay=
"20"
@
end=
"onMove"
>
<div
v-for=
"(item, index) in imageList"
:key=
"item + index"
class=
"select_item"
>
<img
:src=
"item"
class=
"gallery"
@
click=
"handleShowLargeDialog(item)"
>
<div
class=
"edit"
@
click=
"handlerChangeImage(item)"
>
编辑
</div>
<div
v-if=
"imageList.length > 0"
class=
"set"
@
click=
"handlerSetMainImage(item, index)"
>
{{ imageMainPosition === index ? '主图' : '设为主图' }}
<div
class=
"item_content"
>
<img
:src=
"item"
class=
"gallery"
@
click=
"handleShowLargeDialog(item)"
>
<div
class=
"edit"
@
click=
"handlerChangeImage(item)"
>
编辑
</div>
<div
v-if=
"imageList.length > 0"
class=
"set"
@
click=
"handlerSetMainImage(item, index)"
>
{{ imageMainPosition === index ? '主图' : '设为主图' }}
</div>
</div>
</div>
</Draggable>
...
...
@@ -283,6 +287,9 @@ export default {
window
.
addEventListener
(
'
scroll
'
,
this
.
handleScroll
)
},
methods
:
{
onMove
(
e
)
{
this
.
imageMainPosition
=
this
.
imageList
.
indexOf
(
this
.
goodsParams
.
topImage
)
},
limitInput
(
value
,
type
)
{
const
newValue
=
(
''
+
value
)
// 第一步:转成字符串
.
replace
(
/
[^\d
^
\.]
+/g
,
''
)
// 第二步:把不是数字,不是小数点的过滤掉
...
...
@@ -734,7 +741,7 @@ export default {
.list
{
margin-top
:
10px
;
.
select_item
{
.
item_content
{
width
:
100px
;
height
:
100px
;
position
:
relative
;
...
...
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