parsley/app/javascript/application.js

92 lines
2.8 KiB
JavaScript
Raw Normal View History

2022-12-01 20:13:53 -06:00
import './styles';
2018-09-10 17:25:36 -05:00
import "vue-resize/dist/vue-resize";
2018-03-29 01:57:00 -05:00
import Vue from 'vue'
2018-04-01 12:17:54 -05:00
import { sync } from 'vuex-router-sync';
2022-12-01 20:13:53 -06:00
import { swInit } from "./lib/ServiceWorker";
import responsiveSync from "./lib/VuexResponsiveSync";
import { createChannel } from "./lib/ActionCable";
2018-04-01 21:43:23 -05:00
import VueProgressBar from "vue-progressbar";
2018-09-10 17:25:36 -05:00
import VueResize from "vue-resize";
2022-12-01 20:13:53 -06:00
import config from './lib/config';
import store from './store';
import router from './router';
import './lib/GlobalMixins';
import App from './components/App';
2018-03-29 01:57:00 -05:00
2022-12-01 20:13:53 -06:00
import AppAutocomplete from "./components/AppAutocomplete";
import AppConfirm from "./components/AppConfirm";
import AppDateTime from "./components/AppDateTime";
import AppDatePicker from "./components/AppDatePicker";
import AppDropdown from "./components/AppDropdown";
import AppExpandTransition from "./components/AppExpandTransition";
import AppIcon from "./components/AppIcon";
import AppIconicIcon from "./components/AppIconicIcon";
import AppModal from "./components/AppModal";
import AppNavbar from "./components/AppNavbar";
import AppPager from "./components/AppPager";
import AppRating from "./components/AppRating";
import AppSearchText from "./components/AppSearchText";
import AppTagEditor from "./components/AppTagEditor";
import AppTextField from "./components/AppTextField";
import AppValidationErrors from "./components/AppValidationErrors";
2018-04-03 20:26:31 -05:00
Vue.component("AppAutocomplete", AppAutocomplete);
2018-05-01 10:55:57 -05:00
Vue.component("AppConfirm", AppConfirm);
2018-04-03 20:26:31 -05:00
Vue.component("AppDateTime", AppDateTime);
2018-04-13 23:32:34 -05:00
Vue.component("AppDatePicker", AppDatePicker);
2018-08-28 16:52:56 -05:00
Vue.component("AppDropdown", AppDropdown);
2018-09-05 17:49:21 -05:00
Vue.component("AppExpandTransition", AppExpandTransition);
2018-04-03 20:26:31 -05:00
Vue.component("AppIcon", AppIcon);
2018-09-10 17:25:36 -05:00
Vue.component("AppIconicIcon", AppIconicIcon);
2018-04-03 20:26:31 -05:00
Vue.component("AppModal", AppModal);
Vue.component("AppNavbar", AppNavbar);
Vue.component("AppPager", AppPager);
Vue.component("AppRating", AppRating);
2020-08-06 20:26:45 -05:00
Vue.component("AppSearchText", AppSearchText);
2018-04-03 20:26:31 -05:00
Vue.component("AppTagEditor", AppTagEditor);
2018-04-13 10:25:18 -05:00
Vue.component("AppTextField", AppTextField);
2018-06-09 12:36:46 -05:00
Vue.component("AppValidationErrors", AppValidationErrors);
2018-04-03 20:26:31 -05:00
2018-04-01 21:43:23 -05:00
Vue.use(VueProgressBar, {
// color: '#bffaf3',
// failedColor: '#874b4b',
// thickness: '5px',
// transition: {
// speed: '0.2s',
// opacity: '0.6s',
// termination: 300
// },
// autoRevert: true,
// location: 'left',
// inverse: false
});
2018-09-10 17:25:36 -05:00
Vue.use(VueResize);
2018-04-01 12:17:54 -05:00
sync(store, router);
2018-09-06 18:16:13 -05:00
responsiveSync(store);
2018-03-29 01:57:00 -05:00
2022-02-02 21:12:27 -06:00
Vue.prototype.$createChannel = function(...args) {
createChannel(null, ...args);
}
2018-03-29 01:57:00 -05:00
document.addEventListener('DOMContentLoaded', () => {
const app = document.getElementById('app');
config.baseApiUrl = app.dataset.url;
window.$vm = new Vue({
el: '#app',
store,
2022-12-01 20:13:53 -06:00
router: router,
2018-03-29 01:57:00 -05:00
render: createElement => createElement('App'),
2019-09-13 10:50:28 -05:00
mounted() {
this.$nextTick(() => swInit(store));
},
2018-03-29 01:57:00 -05:00
components: { App }
});
2018-03-29 01:57:00 -05:00
});