mirror of
https://github.com/frappe/books.git
synced 2024-12-25 12:10:06 +00:00
8f2c48c3df
- Simplify modal plugin - Support multiple stacked modals in a modal container - Add formModal plugin
28 lines
557 B
JavaScript
28 lines
557 B
JavaScript
import Form from '../components/Form/Form';
|
|
|
|
export default function installFormModal(Vue) {
|
|
|
|
Vue.mixin({
|
|
computed: {
|
|
$formModal() {
|
|
const open = (doc, options = {}) => {
|
|
const { defaultValues = null, onClose = null } = options;
|
|
this.$modal.show(Form, {
|
|
doctype: doc.doctype,
|
|
name: doc.name,
|
|
defaultValues,
|
|
onClose
|
|
});
|
|
}
|
|
|
|
const close = () => this.$modal.hide();
|
|
|
|
return {
|
|
open,
|
|
close
|
|
}
|
|
}
|
|
}
|
|
})
|
|
}
|