javascript - 传递参数 NativeScript-Vue
问题描述
我试图传递params
到另一条路线Nativescript
,但它总是返回我undefined
。我正在使用nativescript-vue-navigator。
目前在屏幕上我正在调用以下函数
this.$navigator.navigate('/map', { props: { name: 'Rafael Augusto'} } )
在我的地图屏幕上,我试图像这样
export default {
props: ['name'],
mounted(){
console.log(this.name)
}
}
解决方案
真的很晚了,但如果其他两个答案不起作用,可能会对其他人有所帮助:
export default {
props: ['name'],
data() {
name: this.name
}
mounted(){
console.log(this.name)
}
}
推荐阅读
- objective-c - 'SwiftController' 没有可见的@interface 声明选择器(来自objective-c 类)
- html - 如何制作自由格式的图像,作为导航栏的背景?
- ios - 应用程序关闭后,我无法保存 SwiftUI @EnvironmentObject 类的实例
- python - Python django ImportError:无法导入名称(未知位置)
- spring-boot - Flutter图像上传到SpringBoot服务器不起作用
- python - 数据框按多个值分组
- javascript - TypeError 无法读取 null 的属性“1”
- ios - 为什么 tableView 单元格不是动态的?
- java - 为什么这个递归代码无限重复?
- laravel - 无法读取头像图片 mysite.com/storage/app/public/defaults/avatars/user.png 404 错误