|
@@ -94,20 +94,13 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
onChange (e) {
|
|
|
- const len = e.target.value
|
|
|
- if (!e.target.checked && len == 1) {
|
|
|
- this.syncStep = []
|
|
|
- } else {
|
|
|
- // 选中
|
|
|
- if (len > 0 || e.target.checked) {
|
|
|
- this.syncStep = []
|
|
|
- for (let i = 1; i <= len; i++) {
|
|
|
- this.syncStep.push(i)
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.syncStep = []
|
|
|
- }
|
|
|
+ this.syncStep = []
|
|
|
+ const checked = e.target.checked
|
|
|
+ const len = checked ? e.target.value : e.target.value - 1
|
|
|
+ for (let i = 1; i <= len; i++) {
|
|
|
+ this.syncStep.push(i)
|
|
|
}
|
|
|
+ console.log(this.syncStep)
|
|
|
},
|
|
|
setData (data) {
|
|
|
this.detail = data
|