Skip to content

Commit b29b43b

Browse files
committed
【build】uni-simple-router@2.0.0-beta.1
2 parents 3e458cd + 5b5c008 commit b29b43b

File tree

21 files changed

+430
-103
lines changed

21 files changed

+430
-103
lines changed

dist/uni-simple-router.d.ts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ export declare interface AppConfig {
88

99
export declare interface appletsVueHookConfig {
1010
app: appVueHookConfig;
11-
index: indexVueHookConfig;
11+
page: pageVueHookConfig;
12+
component: baseAppHookConfig[];
1213
}
1314

1415
export declare interface appVueHookConfig extends baseAppHookConfig {
1516
onLaunch: Array<hookObjectRule | Function>;
17+
onShow: Array<hookObjectRule | Function>;
18+
onHide: Array<hookObjectRule | Function>;
1619
}
1720

1821
export declare type appVueSortHookRule = 'beforeCreate' | 'created' | 'beforeMount' | 'mounted' | 'onLaunch' | 'onShow' | 'onHide' | 'beforeDestroy' | 'destroyed';
@@ -23,12 +26,12 @@ export declare interface baseAppHookConfig {
2326
created: Array<hookObjectRule | Function>;
2427
beforeMount: Array<hookObjectRule | Function>;
2528
mounted: Array<hookObjectRule | Function>;
26-
onShow: Array<hookObjectRule | Function>;
27-
onHide: Array<hookObjectRule | Function>;
2829
beforeDestroy: Array<hookObjectRule | Function>;
2930
destroyed: Array<hookObjectRule | Function>;
3031
}
3132

33+
export declare type comVueSortHookRule = 'beforeCreate' | 'created' | 'beforeMount' | 'mounted' | 'beforeDestroy' | 'destroyed';
34+
3235
export declare function createRouter(params: InstantiateConfig): Router;
3336

3437
export declare interface debuggerArrayConfig {
@@ -82,15 +85,6 @@ export declare enum hookToggle {
8285
'enterHooks' = "beforeEnter"
8386
}
8487

85-
export declare interface indexVueHookConfig extends baseAppHookConfig {
86-
onLoad: Array<hookObjectRule | Function>;
87-
onReady: Array<hookObjectRule | Function>;
88-
onUnload: Array<hookObjectRule | Function>;
89-
onResize: Array<hookObjectRule | Function>;
90-
}
91-
92-
export declare type indexVueSortHookRule = 'beforeCreate' | 'created' | 'beforeMount' | 'mounted' | 'onLoad' | 'onReady' | 'onShow' | 'onResize' | 'onHide' | 'beforeDestroy' | 'destroyed' | 'onUnload';
93-
9488
export declare interface InstantiateConfig {
9589
[key: string]: any;
9690
keepUniOriginNav?: boolean;
@@ -161,6 +155,19 @@ export declare type objectAny = {
161155
[propName: string]: any;
162156
};
163157

158+
export declare type pageTypeRule = 'app' | 'page' | 'component';
159+
160+
export declare interface pageVueHookConfig extends baseAppHookConfig {
161+
onShow: Array<hookObjectRule | Function>;
162+
onHide: Array<hookObjectRule | Function>;
163+
onLoad: Array<hookObjectRule | Function>;
164+
onReady: Array<hookObjectRule | Function>;
165+
onUnload: Array<hookObjectRule | Function>;
166+
onResize: Array<hookObjectRule | Function>;
167+
}
168+
169+
export declare type pageVueSortHookRule = 'beforeCreate' | 'created' | 'beforeMount' | 'mounted' | 'onLoad' | 'onReady' | 'onShow' | 'onResize' | 'onHide' | 'beforeDestroy' | 'destroyed' | 'onUnload';
170+
164171
export declare type proxyHookName = 'beforeHooks' | 'afterHooks';
165172

166173
export declare type reloadNavRule = totalNextRoute | false | undefined | string;
@@ -184,6 +191,7 @@ export declare interface Router {
184191
readonly options: InstantiateConfig;
185192
$lockStatus: boolean;
186193
$route: object | null;
194+
enterPath: string;
187195
appProxyHook: {
188196
app: appVueHookConfig;
189197
};

dist/uni-simple-router.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/uni-simple-router2.0/App.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<script>
22
export default {
33
beforeCreate(){
4-
console.log('appvue--beforeCreate----onload')
4+
console.log('appvue--beforeCreate----beforeCreate')
55
},
66
created(){
7-
console.log('appvue--created----onload')
7+
console.log('appvue--created----created')
88
},
99
mounted(){
10-
console.log('appvue--mounted----onload')
10+
console.log('appvue--mounted----mounted')
1111
},
1212
onLaunch: function() {
1313
console.log('App Launch')

examples/uni-simple-router2.0/common/com/com.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
<template>
22
<view>
33
<h1>组件1</h1>
4+
<comChild></comChild>
45
</view>
56
</template>
67

78
<script>
9+
import comChild from '../comChild/comChild.vue'
810
export default {
11+
components:{
12+
comChild
13+
},
914
data() {
1015
return {
1116
1217
}
1318
},
1419
beforeCreate(){
15-
console.log('index--beforeCreate----onload')
20+
console.log('index--beforeCreate----beforeCreate')
1621
},
1722
created(){
18-
console.log('index--created----onload')
23+
console.log('index--created----created')
1924
},
2025
mounted(){
21-
console.log('index--mounted----onload')
26+
console.log('index--mounted----mounted')
2227
},
2328
onLoad() {
2429
console.log('index-child-----onload')
2530
},
2631
onShow() {
27-
console.log('index-child-----onShow')
32+
console.log('index-child-----onShow');
2833
},
2934
methods: {
3035
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<template>
2+
<div>
3+
<h1>子组件的子组件</h1>
4+
</div>
5+
</template>
6+
7+
<script>
8+
export default {
9+
data() {
10+
return {
11+
12+
}
13+
},
14+
beforeCreate(){
15+
console.log('comChild--beforeCreate----beforeCreate')
16+
},
17+
created(){
18+
console.log('comChild--created----created')
19+
},
20+
mounted(){
21+
console.log('comChild--mounted----mounted')
22+
},
23+
onLoad() {
24+
console.log('comChild-onLoad-----onload')
25+
},
26+
onShow() {
27+
console.log('comChild-onLoad-----onShow')
28+
},
29+
methods: {
30+
31+
}
32+
}
33+
</script>
34+
35+
<style>
36+
</style>

0 commit comments

Comments
 (0)