You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
import {createRouter, createWebHistory} from 'vue-router'
|
|
|
|
|
import CropField from '@/components/CropField'
|
|
|
|
|
import ItemShop from "@/components/ItemShop";
|
|
|
|
|
|
|
|
|
|
const routes = [
|
|
|
|
|
{
|
|
|
|
|
path: '/',
|
|
|
|
|
name: 'field',
|
|
|
|
|
component: CropField,
|
|
|
|
|
meta: {
|
|
|
|
|
title: 'Field',
|
|
|
|
|
background: '/assets/backgrounds/grass_summer.png'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/shop',
|
|
|
|
|
name: 'shop',
|
|
|
|
|
component: ItemShop,
|
|
|
|
|
meta: {
|
|
|
|
|
title: 'Shop',
|
|
|
|
|
background: '/assets/backgrounds/planks.jpg',
|
|
|
|
|
backgroundSize: '20%'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
|
history: createWebHistory(process.env.BASE_URL),
|
|
|
|
|
routes
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
router.beforeEach((route) => {
|
|
|
|
|
window.setBodyBackground(route.meta.background, route.meta.backgroundSize)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export default router
|