Simple to use and manage modal.

Overview

vue-modal-provider

nice-modal-react vue implementation. Simple to use and manage modal.

benefit:

  • Create modal without losing context
  • No need to maintain show variables
  • Using promise interact

Installation

$ npm install vue-modal-provider

Examples

Embed your application with ModalProvider

<!--App.vue -->
<script setup lang="ts">
import { RouterView } from "vue-router";
import ModalProvider from "vue-modal-provider";
</script>

<template>
  <ModalProvider>
    <RouterView />
  </ModalProvider>
</template>

Create modal component

<!-- Modal.vue -->
<template>
  <el-dialog v-model="visible">
    {{ args }}
    <el-button @click="hide(), resolve(1111), remove()">close</el-button>
  </el-dialog>
</template>

<script lang="ts" setup>
import { useModalRef } from "vue-modal-provider";
const { 
    // show variables
    visible, 
    // close modal
    hide, 
    args,
    // remove modal lose animation
    remove, 
    resolve,
    reject
    } = useModalRef();
</script>

Use in the view

<script lang="ts"  setup>
import { useModal } from "vue-modal-provider";
import TestModal from './Modal.vue'
const {show} = useModal(TestModal)

function showModal() {
    show('test msg').then(c=>{
         console.log(c);
    })
}

</script>

<template>
  <el-button @click="showModal">open modal</el-button>
</template>
You might also like...

An app to manage tasks. A user can add, delete and edit a task and mark it as completed, It uses simple GUI and relies on DOM manipulation in pure JS and using local storage.

An app to manage tasks. A user can add, delete and edit a task and mark it as completed, It uses simple GUI and relies on DOM manipulation in pure JS and using local storage.

An app to manage tasks. A user can add, delete and edit a task and mark it as completed, It uses simple GUI and relies on DOM manipulation in pure JS and using local storage.

Aug 20, 2022

An easy and simple way to manage your financial transactions.

An easy and simple way to manage your financial transactions.

MyWallet An easy and simple way to manage your financial transactions. With MyWallet you can track your incomes and expenses and always keep track of

Nov 16, 2022

Simple and configurable tool to manage daily huddles in a remote team.

Daily Huddle Simple and configurable tool to manage daily huddles in a remote team. See working version. What's this? This repo has been developed as

Oct 2, 2022

A simple web app to manage your time and energy wisely with to do list app.

To Do list Manage your time and energy wisely with to list app. Built With HTML, CSS JavaScript, Webpack Live Demo Live Demo Link Getting Started To g

Oct 21, 2022

Simple yet powerful to-do list app to manage your daily tasks! Built with: CSS, HTML, JavaScript

Simple yet powerful to-do list app to manage your daily tasks! Built with: CSS, HTML, JavaScript

To-Do List Simple yet powerful to-do app to manage your daily tasks! Built With HTML, CSS Fameworks: N/A Technologies: Linters, Git, GitHub, Webpack L

Jul 21, 2022

This project entails a To-do-List whereby a user can input the tasks they want to do, check the tasks done and also clear all tasks when all of them are completed. It is efficient for a user who want to manage their time and keep track of their day.

This project entails a To-do-List whereby a user can input the tasks they want to do, check the tasks done and also clear all tasks when all of them are completed. It is efficient for a user who want to manage their time and keep track of their day.

Screenshot Here is a screenshot for the project. To-Do-List Project This is a Microverse project that entails a to-do-list which one is able to add an

Jun 16, 2022

A magical vite plugin that helps you to generate and manage documentation website.

vite-plugin-book A magical vite plugin that helps you to generate and manage documentation website. ⚠️ This project is still WIP. It's a MVP now. A bu

Dec 20, 2022

Manage and monitorize your notification using only your terminal :3

Manage and monitorize your notification using only your terminal :3

Notifications Monitor Monitor your notifications and get a temporary list of the notifications. Dependencies Node.js (to run the program; by default,

Apr 12, 2022
Comments
  • 捉个文档的虫

    捉个文档的虫

    <!--App.vue -->
    <script setup lang="ts">
    import { RouterView } from "vue-router";
    import { ModalProvider } from "vue-modal-provider";
    
    opened by lsymy 0
Releases(v0.1.1)
Owner
Link
Link
A Simple yet extendable jQuery modal script built for use with inline HTML, images, videos, and galleries.

jQuery Chaos Modal A Simple yet extendable jQuery modal script built for use with inline HTML, forms, and images in mind. There are many other modal p

Matthew Sigley 3 Oct 8, 2020
This app helps manage a bookstore. It comes in handy when you need to manage a personal book store or library. Entirely built on es6.

Awesome Books A Microverse project on learnong javascript. Additional description about the project and its features. Built With HTML5 CSS3 Javascript

Atugonza ( Billions ) Joel 13 Apr 22, 2022
App to manage maintenance calls. App to manage maintenance calls. This application was created for the purpose of studies.

App to manage maintenance calls. App to manage maintenance calls. This application was created for the purpose of studies.

Rodrigo Gonçalves 112 Dec 26, 2022
ToastmeJS is a very simple, flexible and light weigth plugin that shows Notifications and modal Dialogs on your website.

⚡ ToastmeJS ToastmeJS is a very simple, flexible and light weigth plugin that shows Notifications and modal Dialogs on your website. Customize positio

Alejandro Vivas 8 Jun 20, 2022
Create Bootstrap 5 Modal Box using JavaScript with custom title, description, button labels and custom YES button callback

Dynamic BS5 Modal Box Create Bootstrap 5 Modal Box using JavaScript with custom title, description, button labels and custom YES button callback Insta

null 5 Oct 23, 2022
Design-focused web3 modal based on Material UI

@buildship/web3-login (beta) This is a design-focused web3 wallet connecting modal for React based on Material UI. It supports Metamask, WalletConnect

Buildship 25 Jan 1, 2023
Promise-based utility to control modal states in React

Promise-based utility to control modal states in React Zero-dependency library that easily integrates with your existing UI components and allows you

Thiago Zanivan 8 Dec 5, 2022
Dialogs based on Bootstrap 5 modal

Simple dialogs based on Bootstrap 5 modal Lightweight pure js dialogs library, min ad gz size less 2 kB Dependencies bootstrap 5 demo Dialogs ok_cance

Alexander 7 Oct 29, 2022
Accessible, lightweight, stylish modal library in pure JavaScript

accessible-minimodal Accessible, lightweight (< 8 kB), stylish modal library in pure JavaScript Example https://codepen.io/imhvost/pen/LYNazqo (with "

Oleksandr Marchuk 3 Aug 4, 2022
Modal Video Library

Modal Video Modal Video Library Features Not affected by dom structure. Beautiful transition Accessible for keyboard navigation and screen readers. Ri

appleple 261 Nov 30, 2022