mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs(Checkbox): reduce unnecessary reactive
This commit is contained in:
parent
f354513f9e
commit
a2dbf043a1
@ -76,17 +76,15 @@ Use icon slot to custom icon.
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { toRefs, reactive } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
const state = reactive({
|
const checked = ref(true);
|
||||||
checked: true,
|
return {
|
||||||
|
checked,
|
||||||
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
|
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
|
||||||
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png',
|
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png',
|
||||||
});
|
|
||||||
return {
|
|
||||||
...toRefs(state),
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -88,17 +88,15 @@ export default {
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { toRefs, reactive } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
const state = reactive({
|
const checked = ref(true);
|
||||||
checked: true,
|
return {
|
||||||
|
checked,
|
||||||
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
|
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
|
||||||
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png',
|
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png',
|
||||||
});
|
|
||||||
return {
|
|
||||||
...toRefs(state),
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -155,8 +155,6 @@ export default {
|
|||||||
result3: [],
|
result3: [],
|
||||||
checkAllResult: [],
|
checkAllResult: [],
|
||||||
horizontalResult: [],
|
horizontalResult: [],
|
||||||
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
|
|
||||||
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png',
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const group = ref();
|
const group = ref();
|
||||||
@ -181,6 +179,8 @@ export default {
|
|||||||
setRefs,
|
setRefs,
|
||||||
checkAll,
|
checkAll,
|
||||||
toggleAll,
|
toggleAll,
|
||||||
|
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
|
||||||
|
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user