vue-dialog

所属分类:前端开发
开发工具:TypeScript
文件大小:0KB
下载次数:0
上传日期:2023-10-18 13:16:08
上 传 者sh-1993
说明:  以编程方式调用的Vue对话框,
(A programmatically invoked Vue dialog,)

文件列表:
.vscode/ (0, 2023-10-18)
.vscode/extensions.json (75, 2023-10-18)
index.html (339, 2023-10-18)
package-lock.json (53096, 2023-10-18)
package.json (1018, 2023-10-18)
src/ (0, 2023-10-18)
src/components/ (0, 2023-10-18)
src/components/DialogContainer.vue (449, 2023-10-18)
src/index.ts (346, 2023-10-18)
src/types.ts (739, 2023-10-18)
src/useDialog.ts (2704, 2023-10-18)
src/useDialogContainer.ts (1099, 2023-10-18)
tsconfig.json (247, 2023-10-18)
tsconfig.node.json (142, 2023-10-18)
vite.config.ts (524, 2023-10-18)

# Programmatically-callable vue dialog ## Installation ### Install the plugin ```bash npm i @auswuchs/vue-dialog ``` ### Add it to you vue app as a plugin ```ts // Vue 3 // main.ts import { createApp } from 'vue' import App from './App.vue' import VueDialog from '@auswuchs/vue-dialog' const app = createApp(App) app.use(VueDialog) app.mount('#app') ``` ```ts // Nuxt 3 // plugins/vue-dialog.ts import { defineNuxtPlugin } from 'nuxt/app' import VueDialog from '@auswuchs/vue-dialog' export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.use(VueDialog) }) ``` ### Add `DialogContainer` to `App.vue` template: ```html ``` ## Usage Dialog component must contain emits `confirm` and `cancel` to work properly. ```html ``` ```html ``` or ```html ``` ## Passing data from/to dialog You can pass props to dialog component as the second argument of the `useDialog` composable. Data must be an object with component props. For example, if a component has a prop with the name `detail` we can pass it like this `{ detail: { ... } }`. ```javascript const dialog = useDialog( Dialog, { detail: { ... } }, ) ```

近期下载者

相关文件


收藏者