Ejemplo n.º 1
0
(function () {
    var Vue = require('vue')
    if (!Vue) {
        var message = 'Vue not installed'
        alert(message)
        throw new Error(message)
    }
    Vue.use(require('../../src'))
})()
export default ({ env }) => {
  Vue.use(VueGoogleMaps, {
    load: {
      key: env.GOOGLE_MAPS_API_KEY,
      libraries: 'places',
      language: 'en'
    }
  })
}
Ejemplo n.º 3
0
  before(() => {
    Vue.use(VueRouter)
    directiveTest = new ComponentTest('<div><navbar></navbar><router-view>loading...</router-view></div>', { 'navbar': MockNavbarComponent })

    let homeComponent = { template: '<div class="home">Home</div>' }
    let aboutComponent = { template: '<div class="about">About</div>' }
    let listComponent = { template: '<div class="list">List</div>' }

    router = new VueRouter({
      routes: [
        { path: '/', component: homeComponent },
        { path: '/about', component: aboutComponent },
        { path: '/list', component: listComponent }
      ]
    })
  })
Ejemplo n.º 4
0
    run: function (app) {

        Vue.config.debug = true;
        Vue.config.async = false;
        
        Vue.use(VueRouter);
        Vue.component('vue-logo', vueLogo);
        Vue.component('materialize-logo', materializeLogo);
        Vue.component('doc-api', docApi);
        Vue.component('doc-sources', docSources);
        Vue.component('doc-snippet', docSnippet);
        Vue.component('doc-tabs', docTabs);

        var router = new VueRouter({
            history: false,
            root: '/'
        });

        router.map(mapping);

        router.start(App, app);
    },
Ejemplo n.º 5
0
// https://vuex.vuejs.org/zh-cn/intro.html
// make sure to call Vue.use(Vuex) if using a module system
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex as any)

const store = new Vuex.Store({
  state: {
    count: 0
  },
  mutations: {
    increment: (state) => {
      const obj = state
      obj.count += 1
    },
    decrement: (state) => {
      const obj = state
      obj.count -= 1
    }
  }
})

export default store
Ejemplo n.º 6
0
import vuexI18n, { i18nState } from "vuex-i18n";

// declare interface for store's root state
interface RootState {
    i18n: i18nState;
}

// initialize the vuex store using the vuex module. note that you can change the
// name of the module if you wish
const store = new Store<RootState>({});

// initialize the internationalization plugin on the vue instance. note that
// the store must be passed to the plugin. the plugin will then generate some
// helper functions for components (i.e. this.$i18n.set, this.$t) and on the vue
// instance (i.e. Vue.i18n.set).
Vue.use(vuexI18n.plugin, store);

// please note that you must specify the name of the vuex module if it is
// different from i18n. i.e. Vue.use(vuexI18n.plugin, store, "myName")

// add some translations (could also be loaded from a separate file)
// note that it is possible to use placeholders. translations can also be
// structured as object trees and will automatically be flattened by the the
// plugin
const translationsEn = {
  content: "This is some {type} content",
  tree: {
    nested: "This is nested content"
  }
};
Ejemplo n.º 7
0
import Vue from 'vue';
import VueScrollActive from 'vue-scrollactive';

Vue.use(VueScrollActive);

export default {};
Ejemplo n.º 8
0
/// <reference types="../../node" />

const assert = console.assert;
const random = () => Math.trunc(Math.exp(Math.log(Date.now()) * Math.random()));

import * as Vue from 'vue';
import * as VueI18n from 'vue-i18n';
import { ComponentOptions } from 'vue';

/**
 * VueI18n.install
 */
Vue.use(VueI18n);
VueI18n.install(Vue);

/**
 * VueI18n.version
 */
assert(typeof VueI18n.version === 'string');

/**
 * VueI18n Instance
 */
const locale = random().toString();
const key = `_${random()}`;
const value = `${random()}|${random()}|${random()}`;
const i18n = new VueI18n({
  locale,
  fallbackLocale: locale,
  messages: {
    [locale]: {
Ejemplo n.º 9
0
import institution from "./modules/institution";
import search from "./modules/search";
import transcript from "./modules/transcript";

const modules = {
  authentication,
  calendar,
  filter,
  institution,
  search,
  transcript
};

const PRODUCTION = process.env.NODE_ENV === "production";

Vue.use(Vuex);

const plugins = [
  createPersistedState({
    paths: Object.keys(modules).filter(m => m != "institution")
  })
];

if (PRODUCTION) {
  LogRocket.init("e5pnvu/can-i-graduate");
  plugins.push(
    createLogRocket(LogRocket, mutation => {
      if (mutation.type == "authentication/update") {
        return {
          type: mutation.type,
          payload: {
Ejemplo n.º 10
0
import './css/site.css';
import 'bootstrap';
import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);

const routes = [
    { path: '/', component: require('./components/home/home.vue.html') },
    { path: '/work', component: require('./components/work/work.vue.html') },
    { path: '/aboutme', component: require('./components/aboutme/aboutme.vue.html') }
];

new Vue({
    el: '#app-root',
    router: new VueRouter({ mode: 'history', routes: routes }),
    render: h => h(require('./components/app/app.vue.html'))
});