1.0.1 • Published 6 years ago

sync-modal v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Synchronous modal

Usage

import SyncModal from "sync-modal/index.js"

export default {
	components: {
		SyncModal,
	},
	methods: {
		async showModal1(m) {
			let [data, err] = await m.show()
			if (err) throw err
			console.log(data)
		},
	},
}
<div>
<button @click="showModal1($refs.modal1)"></button>
<sync-modal ref="modal1">
	<button @clock="$ref.modal1.success('123')">OK</button>
	<button @click="$refs.modal1.exit('force close')">Close</button>
</sync-modal>
</div>