diff --git a/playground/src/views/examples/drawer/index.vue b/playground/src/views/examples/drawer/index.vue index 56d983005..b57c59460 100644 --- a/playground/src/views/examples/drawer/index.vue +++ b/playground/src/views/examples/drawer/index.vue @@ -1,6 +1,8 @@ diff --git a/playground/src/views/examples/drawer/typed-data-auto-demo.vue b/playground/src/views/examples/drawer/typed-data-auto-demo.vue new file mode 100644 index 000000000..5af522589 --- /dev/null +++ b/playground/src/views/examples/drawer/typed-data-auto-demo.vue @@ -0,0 +1,29 @@ + + + diff --git a/playground/src/views/examples/drawer/typed-data-contract.ts b/playground/src/views/examples/drawer/typed-data-contract.ts new file mode 100644 index 000000000..96ab8e255 --- /dev/null +++ b/playground/src/views/examples/drawer/typed-data-contract.ts @@ -0,0 +1,13 @@ +import { createVbenDrawer } from '@vben/common-ui'; + +export interface ExplicitDrawerData { + message: string; + method: '显式泛型'; +} + +export interface FactoryDrawerData { + message: string; + method: '契约工厂'; +} + +export const useFactoryDrawer = createVbenDrawer(); diff --git a/playground/src/views/examples/drawer/typed-data-explicit-demo.vue b/playground/src/views/examples/drawer/typed-data-explicit-demo.vue new file mode 100644 index 000000000..cad5315e0 --- /dev/null +++ b/playground/src/views/examples/drawer/typed-data-explicit-demo.vue @@ -0,0 +1,24 @@ + + + diff --git a/playground/src/views/examples/drawer/typed-data-factory-demo.vue b/playground/src/views/examples/drawer/typed-data-factory-demo.vue new file mode 100644 index 000000000..b4ee168e3 --- /dev/null +++ b/playground/src/views/examples/drawer/typed-data-factory-demo.vue @@ -0,0 +1,24 @@ + + + diff --git a/playground/src/views/examples/modal/index.vue b/playground/src/views/examples/modal/index.vue index 7b659e4ce..5631e7c88 100644 --- a/playground/src/views/examples/modal/index.vue +++ b/playground/src/views/examples/modal/index.vue @@ -1,4 +1,6 @@ + + diff --git a/playground/src/views/examples/modal/typed-data-contract.ts b/playground/src/views/examples/modal/typed-data-contract.ts new file mode 100644 index 000000000..87e74275d --- /dev/null +++ b/playground/src/views/examples/modal/typed-data-contract.ts @@ -0,0 +1,13 @@ +import { createVbenModal } from '@vben/common-ui'; + +export interface ExplicitModalData { + message: string; + method: '显式泛型'; +} + +export interface FactoryModalData { + message: string; + method: '契约工厂'; +} + +export const useFactoryModal = createVbenModal(); diff --git a/playground/src/views/examples/modal/typed-data-explicit-demo.vue b/playground/src/views/examples/modal/typed-data-explicit-demo.vue new file mode 100644 index 000000000..f33006660 --- /dev/null +++ b/playground/src/views/examples/modal/typed-data-explicit-demo.vue @@ -0,0 +1,24 @@ + + + diff --git a/playground/src/views/examples/modal/typed-data-factory-demo.vue b/playground/src/views/examples/modal/typed-data-factory-demo.vue new file mode 100644 index 000000000..4713f8488 --- /dev/null +++ b/playground/src/views/examples/modal/typed-data-factory-demo.vue @@ -0,0 +1,24 @@ + + +