From: Eduardo San Martin Morote Date: Tue, 6 Oct 2020 13:04:08 +0000 (+0200) Subject: chore: add functional component to playground X-Git-Tag: v4.0.0-rc.1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5e13b25a674561b727704c9704864312267f44c;p=thirdparty%2Fvuejs%2Frouter.git chore: add functional component to playground --- diff --git a/e2e/encoding/index.ts b/e2e/encoding/index.ts index ac9dafe8..bc28f626 100644 --- a/e2e/encoding/index.ts +++ b/e2e/encoding/index.ts @@ -1,6 +1,6 @@ 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: `
A component
`, @@ -14,6 +14,9 @@ const ParamId = defineComponent({ template: `
id: "{{ $route.params.id }}"
`, }) +const FunctionalView: FunctionalComponent = () => + h('div', 'functional component') + // full URL / !"$&'()*+,:;<=>%3F@[]^`{|}?a= !"$&'()*+,/:;<=>?@[]^`{|}# !"#$&'()*+,:;<=>?@[]^`{|} const router = createRouter({ @@ -21,6 +24,7 @@ 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 },