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
e7f412e8
Commit
e7f412e8
authored
Aug 13, 2020
by
JingChao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clearable与placeholder
parent
7c1ac607
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
11 deletions
+64
-11
index.vue
packages/components/DateFiled/index.vue
+29
-2
SelectFiled.vue
packages/components/Select/SelectFiled.vue
+27
-2
select.vue
packages/components/Select/select.vue
+2
-2
home.vue
src/pages/home.vue
+6
-5
No files found.
packages/components/DateFiled/index.vue
View file @
e7f412e8
...
@@ -9,10 +9,13 @@
...
@@ -9,10 +9,13 @@
<section
:class=
"
{'required':required}" :style="{'flex':proportion[0] }" class="name">
{{
label
}}
</section>
<section
:class=
"
{'required':required}" :style="{'flex':proportion[0] }" class="name">
{{
label
}}
</section>
<section
:style=
"
{'flex':proportion[1] }" class="date-content">
<section
:style=
"
{'flex':proportion[1] }" class="date-content">
<input
<input
v-model=
"value"
:disabled=
"disabled"
type=
"text"
readonly
v-model=
"value"
:disabled=
"disabled"
:placeholder=
"dataPlaceholder"
type=
"text"
readonly
@
click=
"showDate"
>
@
click=
"showDate"
>
<!--
<slot
name=
"icon"
/>
-->
<!--
<slot
name=
"icon"
/>
-->
<img
v-if=
"showIcon"
:src=
"selectIcon"
class=
"icon"
>
<i
v-if=
"showClean"
class=
"icon ion-close-circled"
@
click=
"cleanValue"
/>
<!--
<slot
name=
"icon"
/>
-->
<img
v-if=
"!showClean"
:src=
"selectIcon"
class=
"icon"
>
</section>
</section>
</section>
</section>
</section>
</section>
...
@@ -26,6 +29,14 @@ export default {
...
@@ -26,6 +29,14 @@ export default {
default
:
null
,
default
:
null
,
type
:
String
|
Date
,
type
:
String
|
Date
,
},
},
placeholder
:
{
type
:
String
,
default
:
null
,
},
clearable
:
{
type
:
Boolean
,
default
:
false
,
},
format
:
{
format
:
{
default
:
'YYYY-MM-DD'
,
default
:
'YYYY-MM-DD'
,
type
:
String
,
type
:
String
,
...
@@ -89,8 +100,24 @@ export default {
...
@@ -89,8 +100,24 @@ export default {
selectIcon
()
{
selectIcon
()
{
return
this
.
rightIcon
?
this
.
rightIcon
:
this
.
Icon
return
this
.
rightIcon
?
this
.
rightIcon
:
this
.
Icon
},
},
dataPlaceholder
()
{
return
this
.
placeholder
?
this
.
placeholder
:
'请输入'
+
this
.
label
},
showClean
()
{
let
vm
=
this
if
(
vm
.
clearable
&&
vm
.
value
)
{
return
true
}
else
{
return
!
vm
.
showIcon
}
},
},
},
methods
:
{
methods
:
{
cleanValue
()
{
this
.
$emit
(
'input'
,
null
)
this
.
$emit
(
'clean'
,
null
)
},
showDate
()
{
showDate
()
{
let
vm
=
this
let
vm
=
this
if
(
!
vm
.
disabled
)
{
if
(
!
vm
.
disabled
)
{
...
...
packages/components/Select/SelectFiled.vue
View file @
e7f412e8
...
@@ -9,11 +9,13 @@
...
@@ -9,11 +9,13 @@
<section
:class=
"
{'required':required}" :style="{'flex':proportion[0] }" class="name">
{{
label
}}
</section>
<section
:class=
"
{'required':required}" :style="{'flex':proportion[0] }" class="name">
{{
label
}}
</section>
<section
:style=
"
{'flex':proportion[1] }" class="select-content">
<section
:style=
"
{'flex':proportion[1] }" class="select-content">
<input
<input
v-model=
"codeName"
:disabled=
"disabled"
type=
"text"
readonly
v-model=
"codeName"
:disabled=
"disabled"
:placeholder=
"selectPlaceholder"
type=
"text"
readonly
@
click=
"showSelect"
>
@
click=
"showSelect"
>
<input
v-model=
"value"
type=
"text"
hidden
>
<input
v-model=
"value"
type=
"text"
hidden
>
<i
v-if=
"showClean"
class=
"icon ion-close-circled"
@
click=
"cleanValue"
/>
<!--
<slot
name=
"icon"
/>
-->
<!--
<slot
name=
"icon"
/>
-->
<img
v-if=
"
showIco
n"
:src=
"selectIcon"
class=
"icon"
>
<img
v-if=
"
!showClea
n"
:src=
"selectIcon"
class=
"icon"
>
</section>
</section>
</section>
</section>
</section>
</section>
...
@@ -28,6 +30,14 @@ export default {
...
@@ -28,6 +30,14 @@ export default {
default
:
null
,
default
:
null
,
type
:
Number
|
String
,
type
:
Number
|
String
,
},
},
placeholder
:
{
type
:
String
,
default
:
null
,
},
clearable
:
{
type
:
Boolean
,
default
:
false
,
},
dataArray
:
{
dataArray
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[],
default
:
()
=>
[],
...
@@ -118,6 +128,14 @@ export default {
...
@@ -118,6 +128,14 @@ export default {
}
}
return
name
return
name
},
},
showClean
()
{
let
vm
=
this
if
(
vm
.
clearable
&&
vm
.
value
)
{
return
true
}
else
{
return
!
vm
.
showIcon
}
},
minHeight
()
{
minHeight
()
{
if
(
this
.
$parent
.
itemHeight
)
{
if
(
this
.
$parent
.
itemHeight
)
{
return
this
.
$parent
.
itemHeight
+
'px'
return
this
.
$parent
.
itemHeight
+
'px'
...
@@ -128,6 +146,9 @@ export default {
...
@@ -128,6 +146,9 @@ export default {
selectIcon
()
{
selectIcon
()
{
return
this
.
rightIcon
?
this
.
rightIcon
:
this
.
Icon
return
this
.
rightIcon
?
this
.
rightIcon
:
this
.
Icon
},
},
selectPlaceholder
()
{
return
this
.
placeholder
?
this
.
placeholder
:
'请选择'
+
this
.
label
},
},
},
methods
:
{
methods
:
{
selectCall
(
v1
,
v2
,
v3
)
{
selectCall
(
v1
,
v2
,
v3
)
{
...
@@ -140,6 +161,10 @@ export default {
...
@@ -140,6 +161,10 @@ export default {
this
.
$emit
(
'onSelect'
,
v1
,
v2
)
this
.
$emit
(
'onSelect'
,
v1
,
v2
)
}
}
},
},
cleanValue
()
{
this
.
$emit
(
'input'
,
null
)
this
.
$emit
(
'clean'
,
null
)
},
showSelect
()
{
showSelect
()
{
let
vm
=
this
let
vm
=
this
if
(
!
vm
.
disabled
)
{
if
(
!
vm
.
disabled
)
{
...
...
packages/components/Select/select.vue
View file @
e7f412e8
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
background-color: transparent;
background-color: transparent;
&.active {
&.active {
background-color: rgba(0, 0, 0, 0.
2
);
background-color: rgba(0, 0, 0, 0.
5
);
}
}
.show-select-wrapper {
.show-select-wrapper {
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
transition: all cubic-bezier(0.36, 0.66, 0.04, 1) 500ms;
transition: all cubic-bezier(0.36, 0.66, 0.04, 1) 500ms;
bottom: 0 !important;
bottom: 0 !important;
position: absolute !important;
position: absolute !important;
max-height:
5
0% !important;
max-height:
4
0% !important;
width: 100%;
width: 100%;
left: 0;
left: 0;
top: auto;
top: auto;
...
...
src/pages/home.vue
View file @
e7f412e8
...
@@ -98,12 +98,13 @@
...
@@ -98,12 +98,13 @@
<input
slot=
"content"
type=
"text"
>
<input
slot=
"content"
type=
"text"
>
</item>
</item>
<SelectFiled
<SelectFiled
v-model=
"sex"
:dataArray=
"sexList"
:required=
"true"
label=
"性别"
v-model=
"sex"
:dataArray=
"sexList"
required
clearable
label=
"性别"
value-key=
"code_value"
value-key=
"code_value"
value-name=
"code_value_name"
@
onSelect=
"select"
/>
value-name=
"code_value_name"
@
onSelect=
"select"
/>
</list-item>
</list-item>
<DateFiled
<DateFiled
v-model=
"nowDate"
:required=
"true"
label=
"时间"
v-model=
"nowDate"
required
label=
"时间"
clearable
@
onSelect=
"select"
/>
@
onSelect=
"select"
/>
<!--
<h-range
<!--
<h-range
...
@@ -151,10 +152,10 @@ export default {
...
@@ -151,10 +152,10 @@ export default {
rangeBarHeight
:
1
,
rangeBarHeight
:
1
,
rangeHandleHeight
:
20
,
rangeHandleHeight
:
20
,
sex
:
0
,
sex
:
null
,
sexList
:
[{
'code_value'
:
0
,
'code_value_name'
:
'女'
},
{
'code_value'
:
0
,
'code_value_name'
:
'女'
},{
'code_value'
:
0
,
'code_value_name'
:
'女'
}],
sexList
:
[{
'code_value'
:
0
,
'code_value_name'
:
'女'
},
{
'code_value'
:
0
,
'code_value_name'
:
'女'
},
{
'code_value'
:
0
,
'code_value_name'
:
'女'
}],
nowDate
:
'2020-12-25'
,
nowDate
:
null
,
}
}
},
},
watch
:
{},
watch
:
{},
...
...
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