@viewfly/router 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -256,9 +256,13 @@ function Link(props) {
256
256
  }
257
257
  return () => {
258
258
  const Tag = props.tag || 'a';
259
- const attrs = Object.assign({}, props, Object.assign({ onClick: navigate }, props));
259
+ const attrs = Object.assign({}, props, Object.assign({ onClick(ev) {
260
+ var _a;
261
+ navigate(ev);
262
+ (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, ev);
263
+ } }, props));
260
264
  if (Tag === 'a') {
261
- attrs.href = navigator.join(props.to, router, props.queryParams);
265
+ attrs.href = navigator.join(props.to, router, props.queryParams, props.fragment);
262
266
  }
263
267
  if (isActive() && props.active) {
264
268
  attrs.class = [attrs.class, props.active];
package/bundles/index.js CHANGED
@@ -258,9 +258,13 @@ function Link(props) {
258
258
  }
259
259
  return () => {
260
260
  const Tag = props.tag || 'a';
261
- const attrs = Object.assign({}, props, Object.assign({ onClick: navigate }, props));
261
+ const attrs = Object.assign({}, props, Object.assign({ onClick(ev) {
262
+ var _a;
263
+ navigate(ev);
264
+ (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, ev);
265
+ } }, props));
262
266
  if (Tag === 'a') {
263
- attrs.href = navigator.join(props.to, router, props.queryParams);
267
+ attrs.href = navigator.join(props.to, router, props.queryParams, props.fragment);
264
268
  }
265
269
  if (isActive() && props.active) {
266
270
  attrs.class = [attrs.class, props.active];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/router",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "A routing library based on the Viewfly framework that can be run in the browser or Nodejs background.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",