1.1.6 • Published 5 years ago

@o-ui/modal v1.1.6

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

modal

A alert/confirm modal in vue

examples

js

import modal from '@o-ui/modal'
Vue.use(modal)

this.$alert({
  title: 'title',
  message: 'message',
  btnText: 'btnText',
  opacity: 0.2,
  zIndex: 100
}).then(res => {
  // res: confirm/close/mask
  if (res === 'confirm') {
    // ...
  }
})
this.$confirm({
  title: 'title',
  message: 'message',
  cancelText: 'cancelText',
  confirmText: 'confirmText'
}).then(res => {
  // res: cancel/confirm/close/mask
  if (res === 'confirm') {
    // ...
  }
})

components

<template>
  <modal title="title" :showModal="showModal" @confirm="confirm">
    <div>custom model content</div>
  </modal>
</template>
<script>
export default {
  data () {
    return {
      showModal: false
    }
  },
  methods: {
    confirm () {
      // ...
    }
  }
}
</script>

params

ParamDescription
showModalwhen use modal by components
titlemodal title
messagemodal message
cancelTextconfirm left button text
confirmTextconfirm right button text
btnTextalert button text
preventScrollprevent elements scroll under the mask
clickMaskresolve mask click
modalTypealert/confirm
opacitymask opacity
zIndexmodal mask z-index && modal z-index
showMaskmodal mask show/hide
1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago