Skip to content

Commit 62f7a4e

Browse files
committed
fix(schema-form): update props issue
1 parent adbda89 commit 62f7a4e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/core/schema-form/src/schema-form.vue

+5-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</template>
3434

3535
<script lang="ts" setup>
36-
import { useAttrs, watchEffect } from 'vue';
36+
import { useAttrs, watch } from 'vue';
3737
import { pick } from 'lodash-es';
3838
import { Form, Row } from 'ant-design-vue';
3939
import SchemaFormItem from './schema-form-item.vue';
@@ -79,7 +79,10 @@
7979
const formEvents = useFormEvents({ ...formState, emit, handleFormValues });
8080
8181
// 同步外部对props的修改
82-
watchEffect(() => setSchemaFormProps(props));
82+
watch(props, () => setSchemaFormProps(props), {
83+
deep: true,
84+
immediate: true,
85+
});
8386
8487
// 当前组件所有的状态和方法
8588
const instance = {

0 commit comments

Comments
 (0)