4***@qq.com
4***@qq.com
  • 发布:2024-12-27 14:52
  • 更新:2024-12-27 14:59
  • 阅读:74

【报Bug】纯nvue项目编译到鸿蒙,路由跳转提示 navigateTo:fail locked

分类:鸿蒙Next

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: macOS Sequoia 15.2

HBuilderX类型: Alpha

HBuilderX版本号: 4.43

手机系统: HarmonyOS NEXT

手机系统版本号: HarmonyOS NEXT Developer Beta2

手机厂商: 模拟器

手机机型: 默认

页面类型: nvue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

index.nvue

<template>  
    <view class="content">  
        <image class="logo" src="/static/logo.png"></image>  
        <view class="text-area">  
            <text class="title">{{ title }}</text>  
        </view>  

        <view class="" @click="toDemo">  
            <text>to demo page</text>  
        </view>  
    </view>  
</template>  

<script>  
export default {  
    data() {  
        return {  
            title: 'Hello'  
        };  
    },  
    onLoad() {},  
    methods: {  
        toDemo() {  
            console.log('toDemo-click');  
            uni.navigateTo({  
                url: '/pages/demo/demo',  
                success(e) {  
                    console.log(e);  
                },  
                fail(e) {  
                    console.log(e);  
                }  
            });  
        }  
    }  
};  
</script>  

<style>  
.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>

demo.nvue

<template>  
    <view>  
        <text>demo</text>  
    </view>  
</template>  

<script>  
export default {  
    data() {  
        return {};  
    },  
    methods: {}  
};  
</script>  

<style></style>

操作步骤:

manifest.json 勾选 fast启动模式 和 纯nvue项目,编译到鸿蒙

预期结果:

路由跳转正常

实际结果:

路由跳转异常,提示 navigateTo:fail locked

bug描述:

HBuilderX 新建一个空白的 uni-app 项目,选vue3,编译到鸿蒙

1、默认设置,路由跳转正常
2、manifest.json 勾选 fast启动模式,路由跳转正常
2、manifest.json 勾选 fast启动模式 和 纯nvue项目,路由跳转异常
提示 navigateTo:fail locked

2024-12-27 14:52 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

你是用的 app-plus/nvueLaunchMode ? 鸿蒙上不支持 plus 相关的 API

  • 4***@qq.com (作者)

    "nvueLaunchMode": "", 这个没问题

    "renderer": "native" 去掉这行可以,加上不行

    2024-12-27 15:04

要回复问题请先登录注册