2018-07-14 07:31:37 +00:00
|
|
|
/**
|
|
|
|
* Vue Plugin that registers common UI elements
|
|
|
|
* like Button and Modal into the root Vue instance
|
|
|
|
*/
|
|
|
|
|
|
|
|
import frappe from 'frappejs';
|
|
|
|
import NotFound from '../components/NotFound';
|
|
|
|
import FeatherIcon from '../components/FeatherIcon';
|
|
|
|
import FrappeControl from '../components/controls/FrappeControl';
|
|
|
|
import Button from '../components/Button';
|
|
|
|
import Indicator from '../components/Indicator';
|
|
|
|
import modalPlugin from '../components/Modal/plugin';
|
|
|
|
import formModalPlugin from '../plugins/formModal';
|
2018-09-28 13:10:48 +00:00
|
|
|
import outsideClickDirective from './outsideClickDirective';
|
2018-07-14 07:31:37 +00:00
|
|
|
|
|
|
|
export default function installFrappePlugin(Vue) {
|
|
|
|
Vue.component('not-found', NotFound);
|
|
|
|
Vue.component('feather-icon', FeatherIcon);
|
|
|
|
Vue.component('frappe-control', FrappeControl);
|
|
|
|
Vue.component('f-button', Button);
|
|
|
|
Vue.component('indicator', Indicator);
|
2018-09-28 13:10:48 +00:00
|
|
|
Vue.directive('on-outside-click', outsideClickDirective);
|
2018-07-14 07:31:37 +00:00
|
|
|
|
|
|
|
Vue.use(modalPlugin);
|
|
|
|
Vue.use(formModalPlugin);
|
|
|
|
|
|
|
|
Vue.mixin({
|
|
|
|
computed: {
|
|
|
|
frappe() {
|
|
|
|
return frappe;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// global translation function in every component
|
|
|
|
_(...args) {
|
|
|
|
return frappe._(...args);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2018-09-20 12:43:13 +00:00
|
|
|
}
|