import { createRouter, createWebHistory } from '../../src'
import { RouteComponent } from '../../src/types'
-import { createApp, defineComponent } from 'vue'
+import { createApp, defineComponent, FunctionalComponent, h } from 'vue'
const component: RouteComponent = {
template: `<div>A component</div>`,
template: `<div>id: <span id="p-id">"{{ $route.params.id }}"</span></div>`,
})
+const FunctionalView: FunctionalComponent = () =>
+ h('div', 'functional component')
+
// full URL / !"$&'()*+,:;<=>%3F@[]^`{|}?a= !"$&'()*+,/:;<=>?@[]^`{|}# !"#$&'()*+,:;<=>?@[]^`{|}
const router = createRouter({
history: createWebHistory('/' + __dirname),
routes: [
{ path: '/', component: Home, name: 'home' },
+ { path: '/functional', component: FunctionalView },
{ path: '/:id', component: ParamId, name: 'param' },
{ path: '/documents/:id', name: 'docs', component: ParamId },
{ path: encodeURI('/n/€'), name: 'euro', component },