chore: add isFunction utils and improve isObject

This commit is contained in:
陈嘉涵
2020-01-19 20:13:50 +08:00
parent 3a4107ef49
commit 4b54ec6a18
11 changed files with 32 additions and 31 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
// Utils
import { createNamespace, isObj, isDef } from '../utils';
import { createNamespace, isObject, isDef } from '../utils';
import { route, routeProps } from '../utils/router';
// Mixins
@@ -32,7 +32,7 @@ export default createComponent({
routeActive() {
const { to, $route } = this;
if (to && $route) {
const config = isObj(to) ? to : { path: to };
const config = isObject(to) ? to : { path: to };
const pathMatched = config.path === $route.path;
const nameMatched = isDef(config.name) && config.name === $route.name;