欣坚强 2022-05-21 22:35 采纳率: 57.4%
浏览 39
已结题

为什么会报这个错呢?我明明url给赋了调转的地址啊

报错情况

img

helloworld.vue代码


```javascript
<template>
    <view>
        <navigator url="../index/index" open-type="navigateBack">
            <view class="green" style="width:300px; height:300px;">
            </view>
        </navigator>
    </view>
</template>

<script>
    export default {
        // data() {
        //     return {
                
        //     }
        // },
        // methods: {
            
        // },
        
        onLoad()
        {
            console.log("页面加载")
        },
        
        onShow()
        {
            console.log("页面显示")
        },
        
        onReady()
        {
            console.log("页面初次渲染完成")
        },
        
        onHide()
        {
            console.log("页面隐藏")
        },
        
        onUnload()
        {
            console.log("页面卸载")
        },
        
        onShareAppMessage()
        {
            console.log("分享")
        },
        
        onPagesScroll()
        {
            console.log("页面滚动")
        },
        
        onNavigationBarButtonTap()
        {
            console.log("原生标题栏按钮点击事件")
        },
        
        onBackPress()
        {
            console.log("页面返回")
        },
        
        onPullDownRefresh()
        {
            console.log("用户下拉")
        },
        
        onReachBottom()
        {
            console.log("页面上拉触底事件的处理函数")
        }
    }
</script>

<style>

</style>



index.vue代码
<template>
    <view class="content">
        <!-- <view> -->
        <image class="logo" src="/static/logo.png"></image>
        <view class="text-area">
            <text class="title">{{title}}</text>
            <input type="text" :value="title" @input="change" />
        </view>
        
        <navigator :url="url" >
            <view>
                I am {{age>=18?'成年':'未成年'}} years old.
                <br>
                I have learnt skills such as:{{sss[0]}},{{sss[1]}},{{sss[2]}},{{sss[3]}}
            </view>
        </navigator>
    </view>
</template>

<script>
    export default {
        data()
        {
            return {
                title:'Hello 前端',
                age:17,
                url:"../helloworld/helloworld",
                sss:["Java","Vue","Css","HTML"]
            }
        }
    }
</script>

<style>
    /* css */
    .content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .logo {
        height: 200rpx;
        width: 200rpx;
        margin-top: 200rpx;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 50rpx;
    }

    .text-area {
        /* display: flex; */
        justify-content: center;
    }

    .title {
        font-size: 36rpx;
        color: #8f8f94;
    }
</style>



  • 写回答

2条回答 默认 最新

  • 你好!机器人 2022-05-22 00:03
    关注
    
    <navigator :to="url" >
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 6月15日
  • 已采纳回答 6月7日
  • 创建了问题 5月21日

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?