I'm curious and want to try it, can I make a route in vue 3, where the component I made directly here is like this?
const sampleComponent = {
template: `<section class='px-container py-20'>test</section>`
}
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
scrollBehavior(to, from, savedPosition) {
if (savedPosition) return savedPosition;
else return { top: 0 };
},
routes: [
{
path: "/",
name: "homepage",
component: sampleComponent
}
]
});
Because if I try to like this, it can't produce anything on my screen. maybe you guys can help me explain it, Thanks in advance