🔱: [client] sync upgrade with 2 commits [trident-sync]

chore: 增加打开对话框示例
pull/349/head
GitHub Actions Bot 2025-05-28 19:25:49 +00:00
parent 957d9d8307
commit f802b4c2dd
1 changed files with 43 additions and 2 deletions

View File

@ -72,13 +72,17 @@
</template>
</fs-form-wrapper>
</a-card>
<a-card class="mt-10" title="打开对话框">
<a-button @click="openDialogOnly"> </a-button>
</a-card>
</a-col>
</a-row>
</div>
</fs-page>
</template>
<script lang="ts">
<script lang="tsx">
import { defineComponent, ref } from "vue";
import { message } from "ant-design-vue";
import { CreateCrudOptionsProps, useColumns, useFormWrapper, useFs, utils } from "@fast-crud/fast-crud";
@ -268,6 +272,42 @@ function useFormProvider() {
};
}
function useOpenDialogOnly() {
const { openDialog } = useFormWrapper();
function openDialogOnly() {
openDialog({
wrapper: {
title: "自定义对话框",
is: "a-modal",
footer: false,
buttons: {
cancel: {
show: false
},
reset: {
show: false
},
ok: {
show: false
}
},
slots: {
"form-body-top": () => {
return (
<div>
<a-alert type="warning" message="form-body-top 插槽" />
</div>
);
}
}
}
});
}
return {
openDialogOnly
};
}
export default defineComponent({
name: "FormIndependent",
setup() {
@ -276,7 +316,8 @@ export default defineComponent({
...useFormWrapperUsingTag(),
...useCrudBindingForm(),
...useCrudOptions(),
...useFormProvider()
...useFormProvider(),
...useOpenDialogOnly()
};
}
});