Browse Source

fix(gui-v2): emit issue

pull/3030/head
Wing-Kam Wong 2 years ago
parent
commit
b5ec69bf8b
  1. 8
      packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue
  2. 3
      packages/nc-gui-v2/components/smartsheet/Form.vue

8
packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue

@ -50,10 +50,11 @@ const uiTypesOptions = computed<typeof uiTypes>(() => {
] ]
}) })
const reloadMetaAndData = () => { const reloadMetaAndData = async () => {
emit('cancel') emit('cancel')
getMeta(meta?.value.id as string, true) await getMeta(meta?.value.id as string, true)
reloadDataTrigger?.trigger() reloadDataTrigger?.trigger()
emit('submit')
} }
function onCancel() { function onCancel() {
@ -170,8 +171,7 @@ watch(
@click=" @click="
() => { () => {
addOrUpdate(reloadMetaAndData) addOrUpdate(reloadMetaAndData)
advancedOptions = false advancedOptions.value = false
emit('submit')
} }
" "
> >

3
packages/nc-gui-v2/components/smartsheet/Form.vue

@ -279,7 +279,6 @@ function onEmailChange() {
} }
async function submitCallback() { async function submitCallback() {
console.log('submitCallback')
await loadFormView() await loadFormView()
setFormData() setFormData()
showColumnDropdown.value = false showColumnDropdown.value = false
@ -410,7 +409,7 @@ onMounted(async () => {
</div> </div>
</a-button> </a-button>
<SmartsheetColumnEditOrAdd <SmartsheetColumnEditOrAdd
v-if="showColumnDropdown" v-show="showColumnDropdown"
ref="editOrAddRef" ref="editOrAddRef"
@submit="submitCallback" @submit="submitCallback"
@cancel="showColumnDropdown = false" @cancel="showColumnDropdown = false"

Loading…
Cancel
Save