feat: Button component

This commit is contained in:
chenjiahan
2020-07-05 16:19:54 +08:00
parent 0010bfd461
commit 12c167fbbc
11 changed files with 1007 additions and 17 deletions

View File

@@ -2,12 +2,11 @@
* Vue Router support
*/
import { RenderContext } from 'vue/types';
import VueRouter, { RawLocation } from 'vue-router/types';
import type { Router, RouteLocation } from 'vue-router';
export type RouteConfig = {
url?: string;
to?: RawLocation;
to?: RouteLocation;
replace?: boolean;
};
@@ -19,7 +18,7 @@ function isRedundantNavigation(err: Error) {
);
}
export function route(router: VueRouter, config: RouteConfig) {
export function route(router: Router, config: RouteConfig) {
const { to, url, replace } = config;
if (to && router) {
const promise = router[replace ? 'replace' : 'push'](to);
@@ -37,14 +36,10 @@ export function route(router: VueRouter, config: RouteConfig) {
}
}
export function functionalRoute(context: RenderContext) {
route(context.parent && context.parent.$router, context.props);
}
export type RouteProps = {
url?: string;
replace?: boolean;
to?: RawLocation;
to?: RouteLocation;
};
export const routeProps = {