Sha256: 6ae98abebb273a0a54c592b707449b2276fe8116c739462e00d29fa6d84d41f5

Contents?: true

Size: 773 Bytes

Versions: 6

Compression:

Stored size: 773 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.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

6 entries across 6 versions & 1 rubygems

Version Path
ilog-0.3.3 src/vue/router.js
ilog-0.3.1 src/vue/router.js
ilog-0.3.0 src/vue/router.js
ilog-0.2.2 src/vue/router.js
ilog-0.2.1 src/vue/router.js
ilog-0.2.0 src/vue/router.js