popup组件的结构
<block>
<view
wx:if="{{false}}">
<!-- popup中如果有需要滚动的元素请用scroll-view -->
<view>
<slot />
</view>
</view>
</block>
父组件结构
<popup >
<image src="https://fc1tn.baidu.com/it/u=659687351,3180592754&fm=202&mola=new&crop=v1" />
<audio poster="{{poster}}" name="{{name}}" author="{{author}}" src="{{src}}" id="myAudio" controls loop></audio>
<video
id="myVideo"
src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400"
binderror="videoErrorCallback"
enable-danmu
danmu-btn
show-center-play-btn='{{false}}'
show-play-btn="{{true}}"
controls
picture-in-picture-mode="{{['push', 'pop']}}"
bindenterpictureinpicture='bindVideoEnterPictureInPicture'
bindleavepictureinpicture='bindVideoLeavePictureInPicture'
></video>
</popup>
期待表现:
因为popup内wx:if 为false,不应该加载image,audio,video的资源
但是 ???
network抓包,发现,请求了上述的资源。
这个问题下有官方回答:https://developers.weixin.qq.com/community/develop/doc/000284adc5c310175029dee4a51400?highline=slot%20%E7%94%9F%E5%91%BDzhou
帮顶