当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript vuex-router-sync.sync函数代码示例

本文整理汇总了TypeScript中vuex-router-sync.sync函数的典型用法代码示例。如果您正苦于以下问题:TypeScript sync函数的具体用法?TypeScript sync怎么用?TypeScript sync使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sync函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: createApp

export function createApp() {
  const router = createRouter()
  const store = createStore()

  sync(store, router)

  const app = new Vue({
    router,
    store,
    render: h => h(App)
  })

  return { app, router, store }
}
开发者ID:yuler,项目名称:blog,代码行数:14,代码来源:app.ts

示例2: sync

export const createApp = (): IApp => {
  sync(store, router);

  HttpService.store = store;

  const app: Vue = new Vue(
    {
      router,
      store,
      i18n,
      render: (h) => h(App),
    },
  );

  return { app, router, store, i18n };
};
开发者ID:trungx,项目名称:vue-starter,代码行数:16,代码来源:app.ts

示例3: createStore

const createApp = () => {
	const store = createStore();
	const router = createRouter();

	sync(store, router);

	const app = new Vue({
		store,
		router,
		render: (h) =>
			h(
				'div',
				{
					attrs: {
						id: 'app',
					},
				},
				[h('blog')],
			),
	});

	return {app, router, store};
};
开发者ID:sunny628,项目名称:blog,代码行数:23,代码来源:app.ts

示例4: Vue

Vue.use(VueDND);
Vue.use(VueCodemirror,{});

Vue.use(iView);
Vue.config.productionTip = false;

/* eslint-disable no-new */
const app = new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
});

sync(store, router);

// progress&login
router.beforeEach((to, _from, next) => {
  if (to.path === '/login') {
    localStorage.removeItem('userInfo');
  }
  let userInfo = localStorage.getItem('userInfo');
  if (false && !userInfo && to.path !== '/login') {
    // next({ path: '/login' });
  } else {
    NProgress.start();
    next();
  }
});
router.afterEach(() => {
开发者ID:yuhonyon,项目名称:veditor,代码行数:31,代码来源:main.ts

示例5: VueRouter

import App from './App';


Vue.use(VueRouter);


const router = new VueRouter();

const approuter = Vue.extend({});



router.map({
    '/': {
        component: App
    }
});






sync(Store, router);

router.start(approuter, '#appContainer'); // must stay after map and syncing

/* eslint-disable no-console */
console.log(Store.state);

开发者ID:dottgonzo,项目名称:vue-starter,代码行数:29,代码来源:main.ts

示例6: sync

import Vue from 'vue';
import axios from 'axios';
import VueAxios from 'vue-axios';
import { sync } from 'vuex-router-sync';

import store from './store';
import router from './router';
import app from './components/app.vue';

Vue.use(VueAxios, axios);

const unsync = sync(store, router);

const vm = new Vue({
  components: {
    app
  },
  el: '#app',
  template: '<app />',
  router,
  store
});
开发者ID:CharlesOy,项目名称:DemoReactJs,代码行数:22,代码来源:index.ts

示例7: vuexRouterSync

import './filters'
import './material'

import router from './router'
import store from './store'

// Styles
import './styles/main.scss'

// Scripts
// import 'expose-loader?$!expose-loader?jQuery!jquery'
// import "expose-loader?Tether!tether"
// import 'bootstrap'
// import 'expose-loader?mdc!../node_modules/material-components-web/dist/material-components-web.js'

vuexRouterSync(store, router)

Vue.use(VuePaginate)
Vue.use(Vuelidate)
Vue.use(Vue2Filters)
Vue.use(VueResource)
Vue.use(VueAsyncComputed)

new Vue({
	...require('./views/main.vue'),
	router,
	store,
	el: 'main',
})
开发者ID:InnoDevelopment,项目名称:frontend,代码行数:29,代码来源:main.ts


注:本文中的vuex-router-sync.sync函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。