From cc7c34733423c57d83fe9a5ffb4b8997e299de66 Mon Sep 17 00:00:00 2001 From: Saeid Date: Sat, 31 Aug 2019 19:18:03 +0430 Subject: [PATCH] common app. in plugin --- public/mix-manifest.json | 8 +- resources/js/Global/plugins/apexchart.js | 4 + resources/js/Global/plugins/ckeditor.js | 4 + .../js/Global/plugins/globalComponent.js | 42 +++++++++++ resources/js/Global/plugins/veeValidate.js | 8 ++ resources/js/Home/app.js | 74 +++---------------- 6 files changed, 71 insertions(+), 69 deletions(-) create mode 100644 resources/js/Global/plugins/apexchart.js create mode 100644 resources/js/Global/plugins/ckeditor.js create mode 100644 resources/js/Global/plugins/globalComponent.js create mode 100644 resources/js/Global/plugins/veeValidate.js diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 062e4eb..5a6f86b 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=358ba0b10884670e333e", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=eda0f66d5dc672be683e", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=84b16cc0f70dd3593e50", + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=a3c38711b09aaedc50dc", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=356f66fbb3cb99f5c596", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=de9e6779f1bb079ba1a1", "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=302a5f0d2c4cc7dbbfb5", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=37c7c87ec9eaa744d95b" + "/js/vue/User/app.js": "/js/vue/User/app.js?id=31d333a3b4b73ad2aed9" } diff --git a/resources/js/Global/plugins/apexchart.js b/resources/js/Global/plugins/apexchart.js new file mode 100644 index 0000000..11f0e14 --- /dev/null +++ b/resources/js/Global/plugins/apexchart.js @@ -0,0 +1,4 @@ +import Vue from "vue"; + +import VueApexCharts from "vue-apexcharts"; +Vue.component("apexchart", VueApexCharts); diff --git a/resources/js/Global/plugins/ckeditor.js b/resources/js/Global/plugins/ckeditor.js new file mode 100644 index 0000000..0437037 --- /dev/null +++ b/resources/js/Global/plugins/ckeditor.js @@ -0,0 +1,4 @@ +import Vue from 'vue'; +import CKEditor from "@ckeditor/ckeditor5-vue"; +import "@ckeditor/ckeditor5-build-classic/build/translations/fa.js"; +Vue.use(CKEditor); diff --git a/resources/js/Global/plugins/globalComponent.js b/resources/js/Global/plugins/globalComponent.js new file mode 100644 index 0000000..19351ac --- /dev/null +++ b/resources/js/Global/plugins/globalComponent.js @@ -0,0 +1,42 @@ +import Vue from 'vue'; + + +import VueScrollReveal from "vue-scroll-reveal"; +import Vuetify from 'vuetify' + + +import "popper.js"; +import "bootstrap-v4-rtl"; +import "bootstrap-v4-rtl/scss/bootstrap-rtl.scss"; +import "bootstrap-select"; +import "bootstrap-select/dist/css/bootstrap-select.css"; +import "vuetify/dist/vuetify.min.css"; // Ensure you are using css-loader +import "@Global/assets/Font-Icons/css/fontello.css"; +import "@Global/scss/style.scss"; + +// components +import PartTitle from "@Global/components/Dividers/PartTitle.vue"; +import PageTitle from "@Global/components/Dividers/PageTitle.vue"; +import Checkbox from "@Global/components/Inputs/Checkbox.vue"; +import InfoBlock from "@Global/components/Misc/InfoBlock.vue"; +import Breadcrumbs from "@Global/components/Misc/Breadcrumbs"; + + +Vue.use(VueScrollReveal, { + class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides. + duration: 800, + scale: 1, + distance: '10px', + mobile: false +}); + +Vue.use(Vuetify, { + iconfont: "fa", + rtl: true +}); + +Vue.component("WM-PartTitle", PartTitle); +Vue.component("WM-PageTitle", PageTitle); +Vue.component("WM-Checkbox", Checkbox); +Vue.component("WM-InfoBlock", InfoBlock); +Vue.component("wm-breadcrumbs", Breadcrumbs); \ No newline at end of file diff --git a/resources/js/Global/plugins/veeValidate.js b/resources/js/Global/plugins/veeValidate.js new file mode 100644 index 0000000..538cea8 --- /dev/null +++ b/resources/js/Global/plugins/veeValidate.js @@ -0,0 +1,8 @@ +import Vue from 'vue'; +//validateion +import VeeValidate, { Validator } from "vee-validate"; +import fa from "@Global/utils/vee-validate/locale/fa"; +import "@Global/utils/vee-validate/newRules"; +Vue.use(VeeValidate); + +Validator.localize("fa", fa); \ No newline at end of file diff --git a/resources/js/Home/app.js b/resources/js/Home/app.js index 588f625..17fe196 100644 --- a/resources/js/Home/app.js +++ b/resources/js/Home/app.js @@ -2,87 +2,31 @@ import Vue from 'vue' import App from './App.vue' import router from './router' import store from './store' -import VueScrollReveal from 'vue-scroll-reveal' -import Vuetify from 'vuetify' -import { global } from "@Global/mixins/global"; -import { commingSoon } from "@Global/mixins/commingSoon"; - -import 'popper.js' -import 'bootstrap-v4-rtl' -import 'bootstrap-v4-rtl/scss/bootstrap-rtl.scss' -import 'bootstrap-select' -import 'bootstrap-select/dist/css/bootstrap-select.css' -import 'vuetify/dist/vuetify.min.css' // Ensure you are using css-loader -import '@Global/assets/Font-Icons/css/fontello.css' -import "@Global/scss/style.scss" - - -// components -import PartTitle from "@Global/components/Dividers/PartTitle.vue"; -Vue.component('WM-PartTitle', PartTitle) -import PageTitle from "@Global/components/Dividers/PageTitle.vue"; -Vue.component('WM-PageTitle', PageTitle) -import Checkbox from "@Global/components/Inputs/Checkbox.vue"; -Vue.component('WM-Checkbox', Checkbox) +//components +import '@Global/plugins/globalComponent.js' -import InfoBlock from "@Global/components/Misc/InfoBlock.vue"; -Vue.component('WM-InfoBlock', InfoBlock) - -import Breadcrumbs from '@Global/components/Misc/Breadcrumbs'; -Vue.component('wm-breadcrumbs', Breadcrumbs) +//hint text import HintText from "@Global/components/Texts/Hint.vue"; Vue.component('wm-hint-text', HintText) -/** - * First we will load all of this project's JavaScript dependencies which - * includes Vue and other libraries. It is a great starting point when - * building robust, powerful web applications using Vue and Laravel. - */ - - +//vue window.Vue = require('vue'); -/** - * The following block of code may be used to automatically register your - * Vue components. It will recursively scan this directory for the Vue - * components and automatically register them with their "basename". - * - * Eg. ./components/ExampleComponent.vue -> - */ - -// const files = require.context('./', true, /\.vue$/i) -// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)) -/** - * Next, we will create a fresh Vue application instance and attach it to - * the page. Then, you may begin adding components to this application - * or customize the JavaScript scaffolding to fit your unique needs. - */ - - -Vue.use(Vuetify, { - iconfont: 'fa', - rtl: true, -}); - -// Vue.config.productionTip = false; -Vue.use(VueScrollReveal, { - class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides. - duration: 800, - scale: 1, - distance: '10px', - mobile: false -}); +//mixin +import { global } from "@Global/mixins/global"; +import { commingSoon } from "@Global/mixins/commingSoon"; Vue.mixin({ methods: { ...global["methods"], ...commingSoon["methods"] } }); -import '@Global/plugins/auth' +//auth +import '@Global/plugins/auth' const app = new Vue({