找回密码
 立即注册
搜索

问题求助 路由跳转到另一个界面却不能正常显示

1
回复
1050
查看
[复制链接]

5

主题

11

帖子

80

积分

 楼主| 2018-11-20 21:35:05 显示全部楼层 |阅读模式
今天在开发时遇见一个怪事,我通过正常跳转到另一个界面。但是跳转到这个界面只有有标题显示正常,类容都没显示,包括生命周期都没执行。 下面是我的跳转代码:
  1. openMore()
  2. {
  3. const that = this;
  4. const foo = require('json-loader!./caipu.json');
  5. that.allcaipuList=foo.result;
  6. router.push({
  7. uri: '/IdWebview',
  8. params: { caipukey: that.allcaipuList }
  9. })
  10. },
复制代码
我跳转到IdWebview 的文件夹下的index.ux 以下是我的manifest.json
  1. "router": {
  2. "entry": "Demo",
  3. "pages": {
  4. "Demo": {
  5. "component": "index"
  6. },
  7. "DemoDetail": {
  8. "component": "index"
  9. },
  10. "About": {
  11. "component": "index"
  12. },
  13. "Webview":
  14. {
  15. "component": "index"
  16. },
  17. "IdWebview":
  18. {
  19. "component": "index"
  20. }
  21. }
  22. },
  23. "display": {
  24. "titleBarBackgroundColor": "#f2f2f2",
  25. "titleBarTextColor": "#414141",
  26. "menu": true,
  27. "pages": {
  28. "Demo": {
  29. "titleBarText": "私人厨"
  30. },
  31. "DemoDetail": {
  32. "titleBarText": "菜谱列表"
  33. },
  34. "About": {
  35. "menu": false
  36. },
  37. "Webview":{
  38. "titleBarText": "菜肴详情",
  39. "menu": false
  40. },
  41. "IdWebview":{
  42. "titleBarText": "菜谱列表",
  43. "menu": false
  44. }
  45. }
  46. }
复制代码
最后我跳转的界面 代码
  1. <template>
  2. <text>test</text>
  3. </template>
  4. <style>
  5. </style>
  6. <script>
  7. import router from '@system.router'
  8. import app from '@system.app'
  9. import fetch from '@system.fetch'
  10. import prompt from '@system.prompt'
  11. export default {
  12. data: {
  13. caipukey: []
  14. },
  15. onInit() {
  16. console.log('---0000---');
  17. this.caipukey = JSON.parse(this.caipukey);
  18. console.log(this.caipukey);
  19. },
  20. }
  21. </script>
复制代码
可是我的onInit() 下的console.log('---0000---'); 都没打印,我的test也没显示,不知道我哪里错了 我最先担心的是我的manifest里面IdWebview,中跟IdWebView 文件夹中的字母大小之分,但是我该成相应的大写却不能跳转了。 看了很久就是不知道哪里有问题
2222.png
回复

使用道具 举报

2018-11-21 14:28:34 显示全部楼层
debug开关没有打开把,text放在div里面试一下
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册