Skip to content

MillerRen/vue-modal-bootstrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue2-modal-bootstrap

vue2 modal bootstrap. support render custom component!

import Vue from 'vue'
import VueModalPlugin from 'vue2-modal-bootstrap'
Vue.use(VueModalPlugin)

var vm = this.$modal({
    title: '确定',
    message: '操作后无法撤销',
    prompt: true,
    autoClose: false,
    okText: '好',
    cancelText: '取消',
    size: 'sm',
    callback: function (value) {
      console.log(value)
    },
    data: {
      text: 'this is custom component'
    },
    events: {
      click () {
        console.log('click')
      }
    }
  },
  {
    props: {
      text: ''
    },
    template: '<div @click="$emit(\'click\')">{{text}}</div>'
  }
)

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

For detailed explanation on how things work, consult the docs for vue-loader.

About

vue modal plugin for bootstrap. support render custom component

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published