Merge pull request #54 from 2462870727/main

fix: 增加useModal确认按钮文本
This commit is contained in:
Ah jung
2021-09-22 08:47:45 +08:00
committed by GitHub

View File

@@ -51,9 +51,9 @@
}); });
const subBtuText = computed(() => { const subBtuText = computed(() => {
const { subBtuText } = propsRef.value as any const { subBtuText } = propsRef.value as any;
return subBtuText; return subBtuText || props.subBtuText;
}) });
async function setProps(modalProps: Partial<ModalProps>): Promise<void> { async function setProps(modalProps: Partial<ModalProps>): Promise<void> {
propsRef.value = deepMerge(unref(propsRef) || ({} as any), modalProps); propsRef.value = deepMerge(unref(propsRef) || ({} as any), modalProps);
@@ -63,6 +63,7 @@
return { return {
...attrs, ...attrs,
...unref(getProps), ...unref(getProps),
...unref(propsRef),
}; };
}); });
@@ -92,6 +93,7 @@
function handleSubmit() { function handleSubmit() {
subLoading.value = true; subLoading.value = true;
console.log(subLoading.value)
emit('on-ok'); emit('on-ok');
} }
@@ -106,7 +108,6 @@
if (instance) { if (instance) {
emit('register', modalMethods); emit('register', modalMethods);
} }
</script> </script>
<style lang="less"> <style lang="less">