update: geoComponent添加change事件

This commit is contained in:
xieyonghong 2023-03-24 15:24:51 +08:00
parent 8c2af7fe76
commit 00ca314972
2 changed files with 4 additions and 1 deletions

View File

@ -45,6 +45,7 @@ initAMapApiLoader({
interface EmitProps {
(e: 'update:point', data: string): void;
(e: 'change', data: string): void;
}
const props = defineProps({
point: { type: [Number, String], default: '' },
@ -59,6 +60,7 @@ const inputPoint = computed({
set: (val: any) => {
mapPoint.value = val;
emit('update:point', val);
emit('change', val);
},
});

View File

@ -46,6 +46,7 @@
<GeoComponent
v-else-if="typeMap.get(itemType) === 'geoPoint'"
v-model:point="myValue"
@change='inputChange'
/>
<j-input
v-else-if="typeMap.get(itemType) === 'file'"
@ -172,7 +173,7 @@ const objectValue = ref<string>('');
const handleItemModalSubmit = () => {
myValue.value = objectValue.value.replace(/[\r\n]\s*/g, '');
modalVis.value = false;
emit('change', myValue.value);
inputChange(myValue.value)
};
//