Skip to content

Commit 0dadaff

Browse files
committed
publish
1 parent 25db47a commit 0dadaff

9 files changed

+143
-29
lines changed

.npmignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
/demos
2-
/docs
3-
.git
4-
node_modules
1+
/**
2+
!dist/**
3+
!src/**
4+
!LICENSE
5+
!README.md
6+
!package.json

dist/vue-router-lite.common.js

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router-lite v1.0.0
2+
* vue-router-lite v1.2.0
33
* (c) 2019-present Season Chen
44
* @license MIT
55
*/
@@ -261,7 +261,8 @@ var MemoryRouter = {
261261
"default": 6
262262
},
263263
getUserConfirmation: {
264-
type: Function
264+
type: Function,
265+
"default": null
265266
}
266267
},
267268
data: function data() {
@@ -343,7 +344,8 @@ var HashRouter = {
343344
hashType: {
344345
validator: function validator(value) {
345346
return ["hashbang", "noslash", "slash"].indexOf(value) !== -1;
346-
}
347+
},
348+
"default": 'slash'
347349
},
348350
getUserConfirmation: {
349351
type: Function,
@@ -1027,7 +1029,7 @@ var Prompt = {
10271029
props: {
10281030
when: {
10291031
type: Boolean,
1030-
"default": true
1032+
required: true
10311033
},
10321034
message: {
10331035
type: [Function, String],
@@ -1143,6 +1145,10 @@ function generatePath() {
11431145
var Redirect = {
11441146
name: 'redirect',
11451147
props: {
1148+
// from path
1149+
from: {
1150+
type: String
1151+
},
11461152
// to path
11471153
to: {
11481154
type: [String, Object],
@@ -1152,6 +1158,18 @@ var Redirect = {
11521158
push: {
11531159
type: Boolean,
11541160
"default": false
1161+
},
1162+
exact: {
1163+
type: Boolean,
1164+
"default": false
1165+
},
1166+
strict: {
1167+
type: Boolean,
1168+
"default": false
1169+
},
1170+
sensitive: {
1171+
type: Boolean,
1172+
"default": true
11551173
}
11561174
},
11571175
inject: ['router', 'route'],
@@ -1181,7 +1199,18 @@ var Redirect = {
11811199
},
11821200
// to location
11831201
computeTo: function computeTo() {
1184-
var match = this.route.match; // to
1202+
var from = this.from,
1203+
strict = this.strict,
1204+
exact = this.exact,
1205+
sensitive = this.sensitive,
1206+
route = this.route;
1207+
var pathname = route.location.pathname;
1208+
var match = from ? matchPath(pathname, {
1209+
from: from,
1210+
strict: strict,
1211+
exact: exact,
1212+
sensitive: sensitive
1213+
}) : route.match; // to
11851214

11861215
var p = this.to; // route
11871216

dist/vue-router-lite.esm.browser.js

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router-lite v1.0.0
2+
* vue-router-lite v1.2.0
33
* (c) 2019-present Season Chen
44
* @license MIT
55
*/
@@ -1312,7 +1312,8 @@ const MemoryRouter = {
13121312
default: 6
13131313
},
13141314
getUserConfirmation: {
1315-
type: Function
1315+
type: Function,
1316+
default: null
13161317
}
13171318
},
13181319

@@ -1399,7 +1400,8 @@ const HashRouter = {
13991400
hashType: {
14001401
validator(value) {
14011402
return ["hashbang", "noslash", "slash"].indexOf(value) !== -1;
1402-
}
1403+
},
1404+
default: 'slash'
14031405
},
14041406
getUserConfirmation: {
14051407
type: Function,
@@ -2418,7 +2420,7 @@ const Prompt = {
24182420
props: {
24192421
when: {
24202422
type: Boolean,
2421-
default: true
2423+
required: true
24222424
},
24232425
message: {
24242426
type: [Function, String],
@@ -2547,6 +2549,10 @@ const Redirect = {
25472549
name: 'redirect',
25482550

25492551
props: {
2552+
// from path
2553+
from: {
2554+
type: String
2555+
},
25502556
// to path
25512557
to: {
25522558
type: [String, Object],
@@ -2556,6 +2562,18 @@ const Redirect = {
25562562
push: {
25572563
type: Boolean,
25582564
default: false
2565+
},
2566+
exact: {
2567+
type: Boolean,
2568+
default: false
2569+
},
2570+
strict: {
2571+
type: Boolean,
2572+
default: false
2573+
},
2574+
sensitive: {
2575+
type: Boolean,
2576+
default: true
25592577
}
25602578
},
25612579

@@ -2600,7 +2618,14 @@ const Redirect = {
26002618

26012619
// to location
26022620
computeTo() {
2603-
const { match } = this.route;
2621+
const { from, strict, exact, sensitive, route } = this;
2622+
const pathname = route.location.pathname;
2623+
const match = from ?
2624+
matchPath(
2625+
pathname,
2626+
{ from, strict, exact, sensitive }
2627+
) : route.match;
2628+
26042629
// to
26052630
let p = this.to;
26062631
// route

dist/vue-router-lite.esm.browser.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-router-lite.esm.js

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router-lite v1.0.0
2+
* vue-router-lite v1.2.0
33
* (c) 2019-present Season Chen
44
* @license MIT
55
*/
@@ -256,7 +256,8 @@ var MemoryRouter = {
256256
"default": 6
257257
},
258258
getUserConfirmation: {
259-
type: Function
259+
type: Function,
260+
"default": null
260261
}
261262
},
262263
data: function data() {
@@ -338,7 +339,8 @@ var HashRouter = {
338339
hashType: {
339340
validator: function validator(value) {
340341
return ["hashbang", "noslash", "slash"].indexOf(value) !== -1;
341-
}
342+
},
343+
"default": 'slash'
342344
},
343345
getUserConfirmation: {
344346
type: Function,
@@ -1022,7 +1024,7 @@ var Prompt = {
10221024
props: {
10231025
when: {
10241026
type: Boolean,
1025-
"default": true
1027+
required: true
10261028
},
10271029
message: {
10281030
type: [Function, String],
@@ -1138,6 +1140,10 @@ function generatePath() {
11381140
var Redirect = {
11391141
name: 'redirect',
11401142
props: {
1143+
// from path
1144+
from: {
1145+
type: String
1146+
},
11411147
// to path
11421148
to: {
11431149
type: [String, Object],
@@ -1147,6 +1153,18 @@ var Redirect = {
11471153
push: {
11481154
type: Boolean,
11491155
"default": false
1156+
},
1157+
exact: {
1158+
type: Boolean,
1159+
"default": false
1160+
},
1161+
strict: {
1162+
type: Boolean,
1163+
"default": false
1164+
},
1165+
sensitive: {
1166+
type: Boolean,
1167+
"default": true
11501168
}
11511169
},
11521170
inject: ['router', 'route'],
@@ -1176,7 +1194,18 @@ var Redirect = {
11761194
},
11771195
// to location
11781196
computeTo: function computeTo() {
1179-
var match = this.route.match; // to
1197+
var from = this.from,
1198+
strict = this.strict,
1199+
exact = this.exact,
1200+
sensitive = this.sensitive,
1201+
route = this.route;
1202+
var pathname = route.location.pathname;
1203+
var match = from ? matchPath(pathname, {
1204+
from: from,
1205+
strict: strict,
1206+
exact: exact,
1207+
sensitive: sensitive
1208+
}) : route.match; // to
11801209

11811210
var p = this.to; // route
11821211

dist/vue-router-lite.js

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router-lite v1.0.0
2+
* vue-router-lite v1.2.0
33
* (c) 2019-present Season Chen
44
* @license MIT
55
*/
@@ -1308,7 +1308,8 @@
13081308
"default": 6
13091309
},
13101310
getUserConfirmation: {
1311-
type: Function
1311+
type: Function,
1312+
"default": null
13121313
}
13131314
},
13141315
data: function data() {
@@ -1390,7 +1391,8 @@
13901391
hashType: {
13911392
validator: function validator(value) {
13921393
return ["hashbang", "noslash", "slash"].indexOf(value) !== -1;
1393-
}
1394+
},
1395+
"default": 'slash'
13941396
},
13951397
getUserConfirmation: {
13961398
type: Function,
@@ -2446,7 +2448,7 @@
24462448
props: {
24472449
when: {
24482450
type: Boolean,
2449-
"default": true
2451+
required: true
24502452
},
24512453
message: {
24522454
type: [Function, String],
@@ -2562,6 +2564,10 @@
25622564
var Redirect = {
25632565
name: 'redirect',
25642566
props: {
2567+
// from path
2568+
from: {
2569+
type: String
2570+
},
25652571
// to path
25662572
to: {
25672573
type: [String, Object],
@@ -2571,6 +2577,18 @@
25712577
push: {
25722578
type: Boolean,
25732579
"default": false
2580+
},
2581+
exact: {
2582+
type: Boolean,
2583+
"default": false
2584+
},
2585+
strict: {
2586+
type: Boolean,
2587+
"default": false
2588+
},
2589+
sensitive: {
2590+
type: Boolean,
2591+
"default": true
25742592
}
25752593
},
25762594
inject: ['router', 'route'],
@@ -2600,7 +2618,18 @@
26002618
},
26012619
// to location
26022620
computeTo: function computeTo() {
2603-
var match = this.route.match; // to
2621+
var from = this.from,
2622+
strict = this.strict,
2623+
exact = this.exact,
2624+
sensitive = this.sensitive,
2625+
route = this.route;
2626+
var pathname = route.location.pathname;
2627+
var match = from ? matchPath(pathname, {
2628+
from: from,
2629+
strict: strict,
2630+
exact: exact,
2631+
sensitive: sensitive
2632+
}) : route.match; // to
26042633

26052634
var p = this.to; // route
26062635

dist/vue-router-lite.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-router-lite",
3-
"version": "1.0.0",
3+
"version": "1.2.0",
44
"description": "> vue-router-lite",
55
"main": "dist/vue-router-lite.common.js",
66
"module": "dist/vue-router-lite.esm.js",

vue-router-lite-1.0.6.tgz

73.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)