1.0.6 • Published 2 years ago

vue-simple-dialog v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vue-simple-dialog

Installation

npm i vue-simple-dialog -D

Description

a lightweight customizable dialog box

API

PropertyDescriptionTypeDefaultRequired
visiblewhether the dialog box is visiblebooleantrue
topvalue for top of dialog CSSstringfalsefalse
maskColormask background-colorstringrgba(0,0,0,.45)false
dialogStyledialog styleCSSProperties{ width: '30%', height: '400px', background: '#fff' }false

event

Events NameDescriptionArgumentsVersion
on-closetriggers when the dialog closes() => void

Using

main.ts

import { createApp } from 'vue'
import App from './App.vue'
import vueSimpleDialog from 'vue-simple-dialog';
import 'vue-simple-dialog/dist/style.css';

createApp(App).use(vueSimpleDialog).mount('#app')

Example

demo.vue

<script setup lang="ts">
import { ref } from 'vue';

const visible = ref(false);
const handleClose = () => {
  console.log('dialog is closed')
};
</script>

<template>
  <vue-simple-dialog 
    v-model:visible="visible" 
    top="10%" 
    @on-close="handleClose" 
    :dialog-style="{
      width: '30%',
      height: '400px',
      borderRadius: '2px',
      background: '#fff',
    }"
  >
    dialog slot
  </vue-simple-dialog>
  <button @click="visible = true">test dialog</button>
</template>
1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago