mirror of
https://github.com/frappe/books.git
synced 2024-12-25 20:11:15 +00:00
79b99055e0
- frappe.showModal - Custom textarea rows
28 lines
583 B
JavaScript
28 lines
583 B
JavaScript
import ModalContainer from './ModalContainer';
|
|
import frappe from 'frappejs';
|
|
|
|
const Plugin = {
|
|
install(Vue) {
|
|
this.event = new Vue();
|
|
|
|
Vue.prototype.$modal = {
|
|
show(...args) {
|
|
return Plugin.modalContainer.add(...args);
|
|
},
|
|
|
|
hide(id) {
|
|
Plugin.event.$emit('hide', id);
|
|
}
|
|
};
|
|
|
|
frappe.showModal = Vue.prototype.$modal.show;
|
|
|
|
// create modal container
|
|
const div = document.createElement('div');
|
|
document.body.appendChild(div);
|
|
new Vue({ render: h => h(ModalContainer) }).$mount(div);
|
|
}
|
|
};
|
|
|
|
export default Plugin;
|