mirror of https://github.com/certd/certd
parent
957d9d8307
commit
f802b4c2dd
|
@ -72,13 +72,17 @@
|
||||||
</template>
|
</template>
|
||||||
</fs-form-wrapper>
|
</fs-form-wrapper>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
|
<a-card class="mt-10" title="打开对话框">
|
||||||
|
<a-button @click="openDialogOnly"> 打开对话框 </a-button>
|
||||||
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
</fs-page>
|
</fs-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="tsx">
|
||||||
import { defineComponent, ref } from "vue";
|
import { defineComponent, ref } from "vue";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
import { CreateCrudOptionsProps, useColumns, useFormWrapper, useFs, utils } from "@fast-crud/fast-crud";
|
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({
|
export default defineComponent({
|
||||||
name: "FormIndependent",
|
name: "FormIndependent",
|
||||||
setup() {
|
setup() {
|
||||||
|
@ -276,7 +316,8 @@ export default defineComponent({
|
||||||
...useFormWrapperUsingTag(),
|
...useFormWrapperUsingTag(),
|
||||||
...useCrudBindingForm(),
|
...useCrudBindingForm(),
|
||||||
...useCrudOptions(),
|
...useCrudOptions(),
|
||||||
...useFormProvider()
|
...useFormProvider(),
|
||||||
|
...useOpenDialogOnly()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue