sync-modal
v1.0.1
Published
# Usage
Downloads
3
Readme
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>