diff --git a/playground/src/views/examples/drawer/index.vue b/playground/src/views/examples/drawer/index.vue index 56d98300..b57c5946 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 00000000..5af52258 --- /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 00000000..96ab8e25 --- /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 00000000..cad5315e --- /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 00000000..b4ee168e --- /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 7b659e4c..5631e7c8 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 00000000..87e74275 --- /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 00000000..f3300666 --- /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 00000000..4713f848 --- /dev/null +++ b/playground/src/views/examples/modal/typed-data-factory-demo.vue @@ -0,0 +1,24 @@ + + +