Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hs-sky-ui
Project
Project
Details
Activity
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
何虹
hs-sky-ui
Commits
1f24f7a3
Commit
1f24f7a3
authored
Apr 25, 2020
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复复选组bug
parent
126313a7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
8 deletions
+38
-8
App.vue
src/App.vue
+1
-1
HelloWorld.vue
src/components/HelloWorld.vue
+18
-2
index.vue
src/packages/hs-checkbox-group/index.vue
+19
-5
No files found.
src/App.vue
View file @
1f24f7a3
...
...
@@ -9,7 +9,7 @@
</
template
>
<
script
>
import
HelloWorld
from
"./components/
hsTable
.vue"
;
import
HelloWorld
from
"./components/
HelloWorld
.vue"
;
export
default
{
name
:
"App"
,
...
...
src/components/HelloWorld.vue
View file @
1f24f7a3
...
...
@@ -8,6 +8,10 @@
></hsSelectPlus>
<el-button
@
click=
"change1"
>
change1
</el-button>
<el-button
@
click=
"change2"
>
change2
</el-button>
<hsCheckboxGroup
v-model=
"checkList"
:allSourceData=
'configData'
></hsCheckboxGroup>
</div>
</
template
>
...
...
@@ -17,6 +21,7 @@ export default {
mixins
:
[
uc
],
data
()
{
return
{
checkList
:
'B,A'
,
selectValue
:
"1052069380861628416"
,
allSourceData
:
{
config
:
{
...
...
@@ -42,7 +47,7 @@ export default {
label
:
"name"
,
is_computed
:
false
},
sourceData
:
[]
,
sourceData
:
[]
},
show
:
false
,
config
:
{
...
...
@@ -66,6 +71,17 @@ export default {
value
:
"id"
,
label
:
"name"
,
is_computed
:
false
},
configData
:
{
sourceData
:
[
{
label
:
"A"
},
{
label
:
"B"
}
],
config
:
{}
}
};
},
...
...
@@ -75,7 +91,7 @@ export default {
},
change2
()
{
this
.
allSourceData
.
sourceData
=
[{
value
:
2
,
label
:
3
}];
}
,
}
}
};
</
script
>
\ No newline at end of file
src/packages/hs-checkbox-group/index.vue
View file @
1f24f7a3
...
...
@@ -6,8 +6,8 @@
<div
class=
"inputCurr"
>
<el-checkbox-group
v-model=
"value_inner"
>
<el-checkbox
v-for=
"(item
,index
) in dataList"
:key=
'i
ndex
'
v-for=
"(item) in dataList"
:key=
'i
tem.label
'
:label=
'item.label'
:disabled=
'item.disabled'
>
...
...
@@ -65,16 +65,22 @@ export default {
deep
:
true
},
value
(
val
)
{
this
.
value_inner
=
val
;
this
.
initValue
()
},
value_inner
(
val
)
{
this
.
$emit
(
"input"
,
val
);
let
value_
=
[];
if
(
typeof
val
===
"string"
)
{
value_
=
val
.
join
();
}
else
{
value_
=
val
;
}
this
.
$emit
(
"input"
,
value_
);
}
},
data
()
{
return
{
elId
:
""
,
value_inner
:
""
,
value_inner
:
[]
,
jsoneditorVisible
:
false
,
configData
:
{
title
:
""
...
...
@@ -84,11 +90,19 @@ export default {
},
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
initValue
()
const
{
config
,
sourceData
}
=
this
.
allSourceData
;
this
.
initConfigData
(
config
,
sourceData
);
});
},
methods
:
{
initValue
(){
if
(
typeof
this
.
value
===
"string"
)
{
this
.
value_inner
=
this
.
value
.
split
(
","
);
}
else
{
this
.
value_inner
=
this
.
value
;
}
},
initConfigData
(
config
,
sourceData
)
{
this
.
initConfig
(
_
.
cloneDeep
(
config
));
this
.
initData
(
_
.
cloneDeep
(
sourceData
));
...
...
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