Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7def3e2

Browse files
committed
fix: disable pageRouting when not in use
fixnativescript-vue#98
1 parentf185cfc commit7def3e2

File tree

5 files changed

+9
-80
lines changed

5 files changed

+9
-80
lines changed

‎platform/nativescript/plugins/router-plugin.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,21 @@ export default {
107107
}
108108

109109
constrouter=this.$options.router
110+
constisPageRouting=router.options.pageRouting
110111
constself=this
111112

113+
if(!isPageRouting){
114+
// if not in page mode, we don't care
115+
return
116+
}
117+
112118
patchRouter(router,Vue)
113119

114120
// Overwrite the default $start function
115121
this.$start=()=>{
116122
this.__is_root__=true
117123
this.__started__=true// skips the default start procedure
124+
this.$options.render=()=>{}// removes warning for no render / template
118125

119126
// Mount the root component
120127
constplaceholder=Vue.$document.createComment('placeholder')

‎platform/nativescript/runtime/components/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import ActionBar from './action-bar'
22
importActionItemfrom'./action-item'
33
importListViewfrom'./list-view'
44
importNavigationButtonfrom'./navigation-button'
5-
importRouterPagefrom'./router-page'
65
importTabViewfrom'./tab-view'
76
importTabViewItemfrom'./tab-view-item'
87
importVTemplatefrom'./v-template'
@@ -12,7 +11,6 @@ export default {
1211
ActionItem,
1312
ListView,
1413
NavigationButton,
15-
RouterPage,
1614
TabView,
1715
TabViewItem,
1816
VTemplate

‎platform/nativescript/runtime/components/router-page.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎samples/app/app-with-router-pages.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const Baz = {
4343
}
4444

4545
constrouter=newVueRouter({
46+
pageRouting:true,
4647
routes:[
4748
{path:'/foo',component:Foo},
4849
{path:'/bar',component:Bar},
@@ -54,9 +55,5 @@ const router = new VueRouter({
5455
router.replace('/foo')
5556

5657
newVue({
57-
router,
58-
template:`<router-page />`,
59-
created(){
60-
// this.$setPageTransition('slide', 1000)
61-
}
58+
router
6259
}).$start()

‎samples/app/app-with-tabview-router.js

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp