|
|
@@ -29,13 +29,15 @@ interface Options {
|
|
|
}
|
|
|
// 父组件传参props
|
|
|
const props = defineProps<{
|
|
|
- dialogVisible: boolean
|
|
|
+ modelValue: boolean
|
|
|
circleUrl: string
|
|
|
}>()
|
|
|
+const emits = defineEmits(['closeAvatarDialog', 'update:modelValue'])
|
|
|
|
|
|
-const dialogVisible = ref(props.dialogVisible)
|
|
|
-
|
|
|
-const emits = defineEmits(['closeAvatarDialog'])
|
|
|
+const dialogVisible = computed({
|
|
|
+ get: () => props.modelValue,
|
|
|
+ set: value => emits('update:modelValue', value)
|
|
|
+})
|
|
|
// 裁剪组件需要使用到的参数
|
|
|
const options = reactive<Options>({
|
|
|
img: props.circleUrl, // 需要剪裁的图片
|