修复写法JSwitch组件直接使用了 props 中定义的value issues/243
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div :class="prefixCls">
|
||||
<a-select
|
||||
v-if="query"
|
||||
v-model:value="value"
|
||||
v-model:value="state"
|
||||
:options="selectOptions"
|
||||
:disabled="disabled"
|
||||
style="width: 100%"
|
||||
@@ -18,7 +18,7 @@
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
|
||||
import { useRuleFormItem } from '/@/hooks/component/useFormItem';
|
||||
const { prefixCls } = useDesign('j-switch');
|
||||
const props = defineProps({
|
||||
// v-model:value
|
||||
@@ -36,7 +36,7 @@
|
||||
const emit = defineEmits(['change', 'update:value']);
|
||||
|
||||
const checked = ref<boolean>(false);
|
||||
|
||||
const [state] = useRuleFormItem(props, 'value', 'change');
|
||||
watch(
|
||||
() => props.value,
|
||||
(val) => {
|
||||
|
Reference in New Issue
Block a user