Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
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
李俊赕
self-support
Commits
fae1ae09
Commit
fae1ae09
authored
Apr 30, 2021
by
刘用法
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完工页面select组件
parent
6caf4884
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
7 deletions
+46
-7
XhInput.vue
src/components/createCom/XhInput.vue
+2
-1
XhSelect.vue
src/components/createCom/XhSelect.vue
+44
-6
No files found.
src/components/createCom/XhInput.vue
View file @
fae1ae09
...
...
@@ -42,7 +42,8 @@
'border-radius'
:
'12rpx'
,
'color'
:
'#333333'
,
'padding-left'
:
'20rpx'
,
'width'
:
this
.
width
'width'
:
this
.
width
,
'font-size'
:
'26rpx'
}
}
},
...
...
src/components/createCom/XhSelect.vue
View file @
fae1ae09
<!-- ******************* 单个下拉选择 ******************* -->
<
template
>
<view>
<u-input
:value=
"text"
readOnly
@
click=
"show=true"
type=
"select"
/>
<u-action-sheet
:list=
"settings"
v-model=
"show"
@
click=
"actionSheetCallback"
></u-action-sheet>
<view
class=
"xh-select"
>
<u-input
:value=
"text"
readOnly
@
click=
"show=true"
:placeholder=
"placeholder"
:placeholder-style=
"placeholderStyle"
:custom-style=
"customStyle"
:clearable=
"false"
></u-input>
<u-action-sheet
:list=
"settings"
v-model=
"show"
@
click=
"actionSheetCallback"
safe-area-inset-bottom
></u-action-sheet>
<u-icon
class=
"input-icon"
:name=
"show ? 'arrow-up' : 'arrow-down'"
></u-icon>
</view>
</
template
>
...
...
@@ -12,7 +15,16 @@
name
:
'XhSelect'
,
components
:
{},
mixins
:
[
stringMixin
],
props
:
{},
props
:
{
placeholder
:
{
type
:
String
,
default
:
'请选择'
},
width
:
{
// 例如:454rpx
type
:
String
,
default
:
'100%'
}
},
data
()
{
return
{
show
:
false
...
...
@@ -32,7 +44,9 @@
result
=
settings
.
map
(
item
=>
{
return
{
text
:
item
.
label
,
id
:
item
.
key
id
:
item
.
key
,
color
:
'#333333'
,
fontSize
:
26
}
})
return
result
...
...
@@ -40,6 +54,20 @@
text
(){
let
option
=
this
.
item
.
fieldsOptions
.
find
(
a
=>
{
return
a
.
key
===
this
.
dataValue
})
return
option
?
option
.
label
:
''
},
placeholderStyle
()
{
return
'color:#999999;font-size:26rpx'
},
customStyle
()
{
return
{
'background-color'
:
'#F4F5F7'
,
'border-radius'
:
'12rpx'
,
'color'
:
'#333333'
,
'padding-left'
:
'20rpx'
,
'padding-right'
:
'60rpx'
,
'width'
:
this
.
width
,
'font-size'
:
'26rpx'
}
}
},
watch
:
{},
...
...
@@ -54,5 +82,15 @@
}
</
script
>
<
style
>
<
style
lang=
"scss"
scoped
>
.xh-select
{
position
:
relative
;
.input-icon
{
position
:
absolute
;
right
:
20rpx
;
top
:
20rpx
;
color
:
#2272FF
;
}
}
</
style
>
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