UNPKG

@minix-iot/ui

Version:

基于Vue的移动端轻量级UI组件库

35 lines (34 loc) 980 B
import Dialog from './dialog.jsx' import { VueExtension } from '../../utils/extensions/vue.js' export default VueExtension.InvokeComponent(unmount=>({ data(){ return { options:{ show: false, overlay: true, zIndex: 1030, lockScroll: false, duration: 0.36, closeOnClickOveraly: true, title: '', content: '', type: 'confirm', buttons: [], primary: '', onButtonClick:null } } }, methods:{ open(options){ this.options = {...this.options, ...options, show: true} }, onButtonClick(data){ this.options.onButtonClick(data) unmount() } }, render(){ return <Dialog {...{props:this.options} } vOn:close={unmount} vOn:button-click={this.onButtonClick}/> } }))