genda_0927
genda_0927
  • 发布:2021-10-25 11:25
  • 更新:2021-12-27 16:57
  • 阅读:675

【报Bug】vue3 page-meta 无法使用,直接报错 TypeError: this.$pageVm.$on is not a function

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 10.15.3

HBuilderX类型: 正式

HBuilderX版本号: 3.2.9

手机系统: 全部

手机厂商: 华为

页面类型: vue

打包方式: 云端

项目创建方式: HBuilderX

测试过的手机:

iphonex oppo

示例代码:

<template>
<page-meta root-font-size="9.2666666px"></page-meta>

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

</template>

<script>
export default {
data() {
return {
title: 'Hello'
}
},
methods: {
clickHello() {
uni.navigateTo({url: '/pages/hello/hello?index=1'});
}
},
onLoad() {
// plus.navigator.closeSplashscreen();
},
}
</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>

操作步骤:

3.2.9版本vue3 使用 page-meta 无效直接报错 11:14:52.537 TypeError: this.$pageVm.$on is not a function
vue2 可以正常使用,
vue2 与 vue3 代码一致

预期结果:

可正常使用 page-meta 功能

实际结果:

vue3 中无法正常使用

bug描述:

2021-10-25 11:25 负责人:无 分享
已邀请:
DCloud_UNI_Anne

DCloud_UNI_Anne

问题已记录,后续优化,已加分,感谢您的反馈!

l***@163.com

l***@163.com

问题仍然存在

DCloud_uniAD_HDX

DCloud_uniAD_HDX

hx 3.3.3, app h5 验证没有问题,hx版本多少?提供测试代码

该问题目前已经被锁定, 无法添加新回复