UNPKG

primevue

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue) [![Discord Chat](https://img.shields.io/discord/55794023

37 lines (28 loc) 1.48 kB
this.primevue = this.primevue || {}; this.primevue.dialogservice = (function (vue, usedialog, DynamicDialogEventBus) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var DynamicDialogEventBus__default = /*#__PURE__*/_interopDefaultLegacy(DynamicDialogEventBus); var DialogService = { install: (app) => { const DialogService = { open: (content, options) => { const instance = { content: content && vue.markRaw(content), options: options || {}, data: options && options.data, close: (params) => { DynamicDialogEventBus__default["default"].emit('close', { instance, params }); } }; DynamicDialogEventBus__default["default"].emit('open', { instance }); return instance; } }; app.config.unwrapInjectedRef = true; // Remove it after Vue 3.3. Details: https://vuejs.org/guide/components/provide-inject.html#working-with-reactivity app.config.globalProperties.$dialog = DialogService; app.provide(usedialog.PrimeVueDialogSymbol, DialogService); } }; return DialogService; })(Vue, primevue.usedialog, primevue.dynamicdialogeventbus);