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
74356a94
Commit
74356a94
authored
Jun 16, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配件组件增加禁用属性
parent
139255b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
index.vue
src/components/parts/index.vue
+14
-4
readme.md
src/components/parts/readme.md
+1
-0
No files found.
src/components/parts/index.vue
View file @
74356a94
<
template
>
<
template
>
<view
class=
"parts"
>
<view
class=
"parts"
>
<view
class=
"u-flex u-col-center u-row-around lists"
v-if=
"showTitle"
>
<view
class=
"u-flex u-col-center u-row-around lists"
v-if=
"showTitle"
>
<view
v-if=
"showChecked"
class=
"check"
>
<view
v-if=
"showChecked
&& !disabled
"
class=
"check"
>
</view>
</view>
<view
class=
"u-flex-1"
>
<view
class=
"u-flex-1"
>
...
@@ -12,14 +12,15 @@
...
@@ -12,14 +12,15 @@
</view>
</view>
</view>
</view>
<view
class=
"u-flex u-col-center u-row-around lists"
v-for=
"(item, index) in val"
:key=
"index"
>
<view
class=
"u-flex u-col-center u-row-around lists"
v-for=
"(item, index) in val"
:key=
"index"
>
<view
v-if=
"showChecked"
class=
"check"
>
<view
v-if=
"showChecked
&& !disabled
"
class=
"check"
>
<u-checkbox
v-model=
"item.checked"
:name=
"index"
@
change=
"checkChange"
></u-checkbox>
<u-checkbox
v-model=
"item.checked"
:name=
"index"
@
change=
"checkChange"
></u-checkbox>
</view>
</view>
<view
class=
"u-flex-1 name"
>
<view
class=
"u-flex-1 name"
>
{{
item
.
name
}}
{{
item
.
name
}}
</view>
</view>
<view
class=
"num"
>
<view
class=
"num"
>
<u-number-box
v-model=
"item.num"
:min=
"item.min"
:max=
"item.max"
:index=
"index"
@
change=
"numChange"
></u-number-box>
<u-number-box
v-if=
"!disabled"
v-model=
"item.num"
:min=
"item.min"
:max=
"item.max"
:index=
"index"
@
change=
"numChange"
></u-number-box>
<text
class=
"nums"
v-else
>
*
{{
item
.
num
||
1
}}
</text>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -44,7 +45,13 @@
...
@@ -44,7 +45,13 @@
default
()
{
default
()
{
return
false
return
false
}
}
}
},
disabled
:
{
type
:
Boolean
,
default
()
{
return
false
}
}
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -92,6 +99,9 @@
...
@@ -92,6 +99,9 @@
.num
{
.num
{
width
:
200rpx
;
width
:
200rpx
;
text-align
:
center
;
text-align
:
center
;
.nums
{
color
:
#F59A23
;
}
}
}
}
}
}
}
...
...
src/components/parts/readme.md
View file @
74356a94
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
| :---------: | :-----: | :----: | :--------: | :---------------------: |
| :---------: | :-----: | :----: | :--------: | :---------------------: |
| showChecked | Boolean | false | true/false | 是否需要复选框 |
| showChecked | Boolean | false | true/false | 是否需要复选框 |
| showTitle | Boolean | false | true/false | 是否显示标题 |
| showTitle | Boolean | false | true/false | 是否显示标题 |
| disabled | Boolean | true | true/false | 是否禁用 |
| lists | Array |
[]
| - | 列表数据
**格式见下文**
|
| lists | Array |
[]
| - | 列表数据
**格式见下文**
|
### lists 格式
### lists 格式
...
...
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