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

Commite252544

Browse files
committed
fix: fix view already has a parent bug
fixesnativescript-vue#59,closesnativescript-vue#78
1 parent00de33f commite252544

File tree

4 files changed

+33
-8
lines changed

4 files changed

+33
-8
lines changed

‎package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"rollup-plugin-resolve-aliases":"^0.2.0",
7070
"rollup-watch":"^3.2.2",
7171
"semver":"^5.4.1",
72-
"tns-core-modules":"^3.3.0",
72+
"tns-core-modules":"^3.4.0",
7373
"util-inspect":"^0.1.8",
7474
"vue":"^2.5.13"
7575
},
@@ -83,8 +83,7 @@
8383
"!**/node_modules/**"
8484
],
8585
"moduleDirectories": [
86-
"node_modules",
87-
"<rootDir>/node_modules/tns-core-modules"
86+
"node_modules"
8887
],
8988
"modulePathIgnorePatterns": [
9089
"<rootDir>/samples"

‎platform/nativescript/framework.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
global.process=global.process||{}
44
global.process.env=global.process.env||{}
55

6+
import{VUE_VM_REF}from'./runtime'
67
importinspectfrom'util-inspect'
8+
import{topmost}from'ui/frame'
9+
importapplicationfrom'application'
710
importVuefrom'./runtime/index'
811
importModalPluginfrom'./plugins/modal-plugin'
912
importNavigatorPluginfrom'./plugins/navigator-plugin'
@@ -30,4 +33,23 @@ console.keys = function(object) {
3033
console.log(Object.keys(object))
3134
}
3235

36+
// this fixes the issue of resuming the application
37+
// however this might not be the desired functionality
38+
// Todo: figure out if there is a better way to fix application resume.
39+
application.on(application.exitEvent,()=>{
40+
constframe=topmost()
41+
if(frame){
42+
console.log(frame)
43+
frame.eachChildView(child=>{
44+
console.log('found child')
45+
constvm=child[VUE_VM_REF]
46+
47+
if(vm){
48+
vm.$destroy()
49+
}
50+
frame._removeView(child)
51+
})
52+
}
53+
})
54+
3355
exportdefaultVue

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ export default {
2121
constnavigate=frame ?frame.navigate :start
2222

2323
if(isPage(component)){
24-
returnnavigate({
25-
create(){
26-
returncomponent
27-
}
28-
})
24+
returnnavigate(
25+
Object.assign(options,{
26+
create(){
27+
returncomponent
28+
}
29+
})
30+
)
2931
}
3032

3133
constplaceholder=Vue.$document.createComment('placeholder')

‎platform/nativescript/runtime/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const mount = function(el, hydrating) {
5353
page.content=self.$el.nativeView
5454
}
5555

56+
page[VUE_VM_REF]=self
57+
5658
returnpage
5759
}
5860
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp