5***@qq.com
5***@qq.com
  • 发布:2022-07-26 14:28
  • 更新:2022-07-26 21:09
  • 阅读:516

【报Bug】movable-area组件在vue2和vue3表现不一致,在vue2中,仅movable-view会被加载,其他元素会消失

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: macOS Monterey 12.0.1

HBuilderX类型: 正式

HBuilderX版本号: 3.4.18

手机系统: iOS

手机系统版本号: iOS 15

手机厂商: 苹果

手机机型: iPhone 12 Pro

页面类型: nvue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
<template>  
    <view style="flex: 1;display: flex;flex-direction: column;">  
        <movable-area :style="styles" style="background-color: red;" class="move-area">  
            <view style="background-color: blue;height: 20vh;margin-top: 50px;">  
                <text style="color: #FFF;">背景文字1 margin-top: 50px height: 20vh</text>  
            </view>  
            <movable-view direction="all" :x="moveX" :y="moveY" style="background-color: #000;width: 200px;height: 30px;">  
                <text style="color: #FFF;">漂浮拖拽文字1 x="150" y="300"</text>  
            </movable-view>  
        </movable-area>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                styles: {},  
                moveX: 150,  
                moveY: 300  
            };  
        },  
        onLoad () {  
            var info = uni.getSystemInfoSync();  
            this.styles = {  
                height: info.windowHeight + 'px',  
                width: info.windowWidth + 'px'  
            }  
        }  
    }  
</script>  

操作步骤:

如示例工程所示,可以直接通过manifest.json来切换vue版本查看差异

预期结果:

vue2版本下的movable表现和vue3版本下一致

实际结果:

vue2不正常,vue3没问题

bug描述:

vue2模式下,movable-area的子元素仅显示movable-view元素
vue3模式下,非movable-view元素也可以显示出来

从下面的截图可以看出来vue2模式下,只生成了movable-view元素

2022-07-26 14:28 负责人:无 分享
已邀请:
DCloud_UNI_Anne

DCloud_UNI_Anne

已记录后续优化,已加分感谢反馈!

  • a***@foxmail.com

    什么时候优化?导致https://ask.dcloud.net.cn/question/78033问题中想要的效果无法实现

    2022-08-19 11:42

要回复问题请先登录注册