Skip to content

Commit

Permalink
修复写法JSwitch组件直接使用了 props 中定义的value issues/243
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangdaiscott committed Nov 17, 2022
1 parent 2f94ba9 commit ad08851
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Form/src/jeecg/components/JSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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%"
Expand All @@ -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
Expand All @@ -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) => {
Expand Down

0 comments on commit ad08851

Please sign in to comment.