[Improvement] Checkbox: remove unnecessary DOM (#636)

This commit is contained in:
neverland
2018-02-12 10:35:20 +08:00
committed by GitHub
parent 24a50034b6
commit 9673da4131
6 changed files with 93 additions and 145 deletions

View File

@@ -32,7 +32,7 @@
</demo-block>
<demo-block :title="$t('title5')">
<van-checkbox-group v-model="result" :max="max">
<van-checkbox-group v-model="result2" :max="max">
<van-cell-group>
<van-cell v-for="(item, index) in list" :key="index">
<van-checkbox :name="item">{{ $t('checkbox') }} {{ item }}</van-checkbox>
@@ -56,7 +56,7 @@ export default {
checkbox: 'Checkbox',
title3: 'Checkbox Group',
title4: 'Inside a Cell',
title5: 'Configure the maximum amount of checked options'
title5: 'Maximum amount of checked options'
}
},
@@ -70,6 +70,7 @@ export default {
'c'
],
result: ['a', 'b'],
result2: [],
max: 2
};
}
@@ -85,15 +86,13 @@ export default {
.van-cell {
.van-checkbox {
margin: 0;
}
display: flex;
flex-direction: row-reverse;
.van-checkbox__input {
float: right;
position: static;
}
span {
margin: 0;
&__label {
margin: 0;
flex: 1;
}
}
}
}