Skip to content

Commit

Permalink
fix: remove useless console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
JerryC8080 committed Mar 21, 2021
1 parent e536f5e commit 0f4c082
Showing 1 changed file with 27 additions and 29 deletions.
56 changes: 27 additions & 29 deletions example/miniprogram/components/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@

Component({
properties: {
path: String,
type: {
type: String,
value: 'gotoPage'
},
route: String,
query: Object,
delta: Number,
setData: Object,
properties: {
path: String,
type: {
type: String,
value: 'gotoPage',
},
route: String,
query: Object,
delta: Number,
setData: Object,
},

methods: {
gotoPage(event) {
const router = getApp().router;
const { path, route, type, query} = this.data;
const toPath = route || path;

if (['gotoPage', 'navigateTo', 'switchTab', 'redirectTo'].includes(type)) {
(router as any)[type](toPath, query);
}
methods: {
gotoPage() {
const router = getApp().router;
const { path, route, type, query } = this.data;
const toPath = route || path;

if (type === 'navigateBack') {
console.log({event});
const { delta, setData } = this.data;
router.navigateBack({ delta }, { setData })
}
if (
['gotoPage', 'navigateTo', 'switchTab', 'redirectTo'].includes(type)
) {
(router as any)[type](toPath, query);
}

}
}

})
if (type === 'navigateBack') {
const { delta, setData } = this.data;
router.navigateBack({ delta }, { setData });
}
},
},
});

0 comments on commit 0f4c082

Please sign in to comment.