1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-28 08:03:07 +03:00
guide/front/client/router/index.ts
Gigiman e51268fb7e
Vue category toc (#228)
* TestCafe added to project. First test written

* Search input test added

* Seacth input test changed, travis job for testcafe tests added

* Travis bugfix test

* Travis testcafe bugfix test try 2

* Travis testcafe bugfix test ry 3

* Travis testcafe test sleep increased to 10

* Test adding category added but bug with click occurs - check!!!

* Category test (testing the group where test was creating) added - bug fix

* Article component rewrite

* Article component rewritten

* Big with rendering content.html in v-for

* Collapse bug fix

* MInor category visual changes/fixes

* Description, reactivity bug fix

* merge

* Refactoring after code review

* Conflict in styles resolved
2018-10-31 02:09:40 +05:00

35 lines
771 B
TypeScript

import Router from 'vue-router'
function createRouter() {
return new Router({
mode: 'history',
fallback: false,
scrollBehavior: (to) => {
// ads an ability for a scroll to anchor
if (to.hash) {
return { selector: to.hash }
} else {
return { x:0, y:0 }
}
},
routes: [
{
path: '/',
name: 'Index',
component: () => import('../page/Index.vue')
},
{ path: '/haskell', component: () => import('../page/ArticlePage.vue') },
{
path: '/haskell/search/results/',
name: 'SearchResults',
component: () => import('../page/SearchResults.vue'),
props: (route) => ({ query: route.query.query })
},
]
})
}
export {
createRouter
}