Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-easy-ui
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
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
easyUI
hls-easy-ui
Commits
d27d9e52
Commit
d27d9e52
authored
Nov 04, 2019
by
JingChao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
option-item
parent
f42f3afc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
29 deletions
+25
-29
OptionButton.vue
packages/components/ItemOption/OptionButton.vue
+3
-3
index.vue
packages/components/ItemOption/index.vue
+9
-19
hlsPopup.vue
src/pages/hlsPopup.vue
+13
-7
No files found.
packages/components/ItemOption/OptionButton.vue
View file @
d27d9e52
<
template
>
<div
:class=
"type"
class=
"function"
>
{{
text
}}
</div>
<div
:class=
"type"
class=
"function"
@
touchstart
.
capture=
"touchStart"
>
{{
text
}}
</div>
</
template
>
<
script
>
...
...
@@ -22,8 +22,8 @@ export default {
this
.
$parent
&&
this
.
$parent
.
optionItem
.
splice
(
this
.
$parent
.
optionItem
.
indexOf
(
this
),
1
)
},
methods
:
{
buttonClick
(
e
)
{
this
.
$
emit
(
'press'
,
this
.
type
)
touchStart
(
ev
)
{
this
.
$
parent
.
reset
(
)
},
},
}
...
...
packages/components/ItemOption/index.vue
View file @
d27d9e52
<
template
>
<div
:class=
"cusClass"
class=
"swipeout-list"
>
<div
ref=
"item"
:class=
"bottomBorder"
class=
"item"
data-type=
"0"
>
<div
ref=
"item"
:class=
"bottomBorder"
class=
"
option-
item"
data-type=
"0"
>
<div
class=
"list-box"
@
touchstart
.
capture=
"touchStart"
...
...
@@ -57,9 +57,9 @@ export default {
mounted
()
{
this
.
init
()
},
updated
()
{
/*
updated () {
this.init()
},
},
*/
methods
:
{
touchStart
(
ev
)
{
this
.
$refs
.
item
.
style
.
transform
=
'translate3d(0px,0px,0px)'
...
...
@@ -86,16 +86,6 @@ export default {
this
.
startX
=
0
this
.
endX
=
0
},
// 判断当前是否有滑块处于滑动状态
checkSlide
()
{
let
listItems
=
this
.
$refs
.
item
for
(
let
i
=
0
;
i
<
listItems
.
length
;
i
++
)
{
if
(
listItems
[
i
].
dataset
.
type
===
'1'
)
{
return
true
}
}
return
false
},
// 初始化
init
()
{
let
vm
=
this
...
...
@@ -106,10 +96,10 @@ export default {
})
},
reset
()
{
let
l
=
document
.
getElementsByClassName
(
'item'
).
length
let
l
=
document
.
getElementsByClassName
(
'
option-
item'
).
length
for
(
let
i
=
0
;
i
<
l
;
i
++
)
{
document
.
getElementsByClassName
(
'item'
)[
i
].
style
.
transform
=
'translate3d(0px,0px,0px)'
document
.
getElementsByClassName
(
'item'
)[
i
].
dataset
.
type
=
'0'
document
.
getElementsByClassName
(
'
option-
item'
)[
i
].
style
.
transform
=
'translate3d(0px,0px,0px)'
document
.
getElementsByClassName
(
'
option-
item'
)[
i
].
dataset
.
type
=
'0'
}
},
},
...
...
@@ -124,14 +114,14 @@ export default {
overflow: visible;
padding: 0 0 0 15px;
width: 100%;
.item[data-type="0"] {
.
option-
item[data-type="0"] {
transform: translate3d(0px, 0px, 0px);
transition: all 0.4s;
}
.item[data-type="1"] {
.
option-
item[data-type="1"] {
transition: all 1s;
}
.item {
.
option-
item {
overflow: visible;
position: relative;
height: 100%;
...
...
src/pages/hlsPopup.vue
View file @
d27d9e52
...
...
@@ -171,14 +171,15 @@
<div
class=
"list"
>
<item-option
v-for=
"(color,index) in colors"
:key=
"index"
v-for=
"(color,index) in colors"
ref=
"itemOption"
:key=
"index"
class=
"mySlider"
>
<div>
{{
color
.
name
}}
</div>
<div>
{{
color
.
hex
}}
</div>
<div
slot=
"buttons"
>
<option-button
type=
"default"
text=
"默认"
@
click
.
native=
"deleteFun"
/>
<option-button
type=
"primary"
text=
"编辑"
@
click
.
native=
"deleteFun"
/>
<option-button
type=
"warn"
text=
"删除"
@
click
.
native=
"deleteFun"
/>
<option-button
type=
"default"
text=
"默认"
@
click
.
native=
"deleteFun
(index)
"
/>
<option-button
type=
"primary"
text=
"编辑"
@
click
.
native=
"deleteFun
(index)
"
/>
<option-button
type=
"warn"
text=
"删除"
@
click
.
native=
"deleteFun
(index)
"
/>
</div>
</item-option>
</div>
...
...
@@ -418,9 +419,10 @@ export default {
},
})
},
showTime
(
format
)
{
this
.
hlsPopup
.
showTime
({
nowDate
:
'2017-08-12'
,
nowDate
:
(
new
Date
()).
format
(
'yyyy-MM-dd'
)
,
format
:
format
,
callback
:
(
date
)
=>
{
alert
(
date
)
...
...
@@ -429,7 +431,7 @@ export default {
},
showBigPicture
()
{
this
.
hlsPopup
.
showBigPicture
({
imgUrl
:
'http://hlsapp.hand-china.com/
file/20190411/1554983248278.png
'
,
imgUrl
:
'http://hlsapp.hand-china.com/
hls_file/2018/05/F1B6D85E409A4714A8540504B2D133AD
'
,
})
},
...
...
@@ -591,7 +593,11 @@ export default {
},
// e为该元素在数组的下标
deleteFun
(
e
)
{
console
.
log
(
e
)
let
vm
=
this
vm
.
colors
.
remove
(
e
)
vm
.
colors
.
sort
()
debugger
vm
.
$refs
.
itemOption
[
0
].
reset
()
},
// e为该元素在数组的下标
editFun
(
e
)
{
...
...
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