使用可视化组件,movable-area的子view点击事件不响应?
发布于 8 年前 作者 taoyu 13879 次浏览 来自 官方Issues

组件:movable-area和movable-view

基础库:2.8.3

对可移动控件进行组件化,使用<slot></slot> 插入其他视图,但子view的点击事件不响应,请问如何解决?

<movable-area class="custom-class" style="pointer-events: none;height: {{moveViewHeight}};width: 100%;left:0px;top:0px;">
    <view class="" style="height:100%;overflow-y:scroll;">
      <movable-view wx:if="{{show}}" direction="all" x="{{moveViewX}}" y="{{moveViewY}}" animation="{{false}}" style="pointer-events: auto; width: 40px;height:56px;z-index: 999;" bindtap="onHome">
        <view class="img-view">
          <image src='/images/home.png' class="home-img"></image>
          <view class="home-txt">返回首页</view>
        </view>
      </movable-view>
      <slot></slot>
    </view>
  </movable-area>
<movable-custom-view show="{{true}}" moveViewHeight="100%" moveViewX="{{moveViewLeft}}" moveViewY="{{moveViewTop}}">
      <view class="content-view">
        <image src="{{imgSrc}}" mode="widthFix" bindtap="onPreviewImage" data-value="{{imgSrc}}"></image>
      </view>
    </movable-custom-view>

代码片段:https://developers.weixin.qq.com/s/JdkCxHml7mbR

1 回复

就为了做个浮动按钮。。你真是够了。。

https://developers.weixin.qq.com/s/LNy3bHm477bl

回到顶部