Skip to content

Commit

Permalink
优化修复
Browse files Browse the repository at this point in the history
  • Loading branch information
masx200 committed Jul 7, 2021
1 parent 4c7b514 commit 0088cd5
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 94 deletions.
32 changes: 19 additions & 13 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -305,18 +305,20 @@ exports.createHashRouter = function() {
if (!r) throw new TypeError("object,function");
const u = t.paramshref(r);
return n(e, {
ref: c,
href: u,
onClick: e => {
try {
"function" == typeof o && o(e);
} catch (t) {
throw e.preventDefault(), t;
}
e.defaultPrevented || 0 !== e.button || i && "_self" !== i || Z(e) || (e.preventDefault(),
Y(t, r));
},
target: i
...{
ref: c,
href: u,
onClick: e => {
try {
"function" == typeof o && o(e);
} catch (t) {
throw e.preventDefault(), t;
}
e.defaultPrevented || 0 !== e.button || i && "_self" !== i || Z(e) || (e.preventDefault(),
Y(t, r));
},
target: i
}
}, a);
}));
}, exports.createReactView = function({router: t, useCallback: e, createElement: n, useState: r, useEffect: o}) {
Expand All @@ -341,14 +343,17 @@ exports.createHashRouter = function() {
const t = u.component, e = u.children, r = u.props || {};
return Object.assign(r, {
params: i
}), n(t, r, e);
}), n(t, {
...r
}, e);
}
return null;
};
}, exports.createSearchRouter = function() {
return Q("search");
}, exports.createVueLink = function({router: t, resolveComponent: e, defineComponent: n, h: r, Fragment: o}) {
return n({
inheritAttrs: !1,
setup: (n, {slots: a, attrs: i}) => () => {
const {component: n = "a", to: c, onClick: u, target: f, innerRef: s} = i;
if (!c) throw new TypeError("object,function");
Expand All @@ -373,6 +378,7 @@ exports.createHashRouter = function() {
});
}, exports.createVueView = function({onMounted: t, onUnmounted: e, router: n, resolveComponent: r, defineComponent: o, h: a, ref: i, watch: c, Fragment: u}) {
return o({
inheritAttrs: !1,
setup(o, {attrs: f}) {
const {routes: s} = f;
if (!Array.isArray(s)) throw new TypeError("array");
Expand Down
2 changes: 1 addition & 1 deletion dist/index.cjs.map

Large diffs are not rendered by default.

Loading

0 comments on commit 0088cd5

Please sign in to comment.