vc-dialog

vue dialog component

Usage no npm install needed!

<script type="module">
  import vcDialog from 'https://cdn.skypack.dev/vc-dialog';
</script>

README

vue component skeleton

install

npm install vc-dialog --save
    //global varibale  vcDailog
    <script src='../dist/vc-dialog.js'></script>

usage

props

okText

custom the ok button text.

  • default: 确定
  • type: String

cancelText

custom the cancel button text.

  • default: 取消
  • type: String

visiable

control the visiable of dialog.

  • default: false
  • type: Boolean

onOk | optional

the callback for onOk.

  • type: Function

onCancel | optional

the callback of onCancel

  • type: Function

example

  • js
import Vue from 'vue'
import {
        vcDialog
    } from '../dist/vc-dialog.js'

new Vue({
    el: '#app',
    data () {
        return {
            isShow: true,
            okText: 'ok',
            cancelText: 'cancel'
        }
    },
    components: {
        vcDialog
    },
    methods: {
        onOk () {

        },
        onCancel () {

        }
    },
    ready () {
    }
})
<vc-dialog 
    :visible='isShow'
    :okText='okText'
    :cancelText='cancelText'
    :onOk='onOk'
    :onCancel='onCancel'>
    <div class="your-html">
        
    </div>     
</vc-dialog>

dev

  • Build
npm run build
  • Build example
npm run example
  • run server
npm run start