2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/ui/plugins/formModal.js
Faris Ansari f5cdbfa620 Minor UI Fixes
- Remove top border from Navbar
- Link dropdown in Child Table
- Form Modal
2018-07-16 16:50:24 +05:30

36 lines
730 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({
component: Form,
props: {
doctype: doc.doctype,
name: doc.name,
defaultValues,
},
events: {
onClose
},
modalProps: {
noHeader: true
}
});
}
const close = () => this.$modal.hide();
return {
open,
close
}
}
}
})
}