Sha256: 4101295751754134bd6b2803b8d08f9facd5a46ca0d116edcd6dcd6c8cf854da

Contents?: true

Size: 788 Bytes

Versions: 10

Compression:

Stored size: 788 Bytes

Contents

import VueRouter from 'vue-router'

import Post from './components/PostBody'

let routes = [
	{
		path: '/',
		name: 'home',
/*
		components: {
			single: ''
		}
*/
	},
	{
		path: '/tag/:id/',
		name: 'tag',
	},
	{
		path: '/mention/:id/',
		name: 'mention',
	},
	{
		path: '/:id/',
		name: 'post',
		pathToRegexpOptions: { strict: true }
	},
];

export default new VueRouter({
	mode: 'history',
	base: Window.Config.base +  Window.Config.digital.uri,
	routes,
	scrollBehavior (to, from, savedPosition) {
		if (to.hash) {
			return {
				selector: to.hash
				// , offset: { x: 0, y: 10 }
    		}
		}
		if ( to.name == 'tag' ) {
			return { x: 0, y: 0 }
		}
/* FIX THIS ISSUE FROM NAVIGATING TO A TAG FROM INSIDE A POST
		if ( to.name != 'post' ) {
			return { x: 0, y: 0 }
		}
*/
	}
});

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ilog-0.4.9 src/vue/router.js
ilog-0.4.8 src/vue/router.js
ilog-0.4.7 src/vue/router.js
ilog-0.4.6 src/vue/router.js
ilog-0.4.5 src/vue/router.js
ilog-0.4.4 src/vue/router.js
ilog-0.4.3 src/vue/router.js
ilog-0.4.2 src/vue/router.js
ilog-0.4.1 src/vue/router.js
ilog-0.4.0 src/vue/router.js