- scroll-view组件开启自定义下拉后无法用refresher-triggered控制刷新状态?
<scroll-view class="scroll-wrap" scroll-y bounces="{{true}}" adjustDecelerationVelocity="adjustDecelerationVelocity" type="custom" scroll-top="{{scrollTop}}" show-scrollbar="{{false}}" refresher-enabled="{{enablePullRefresh}}" refresher-threshold="{{ refresherThreshold }}" refresher-default-style="none" refresher-triggered="{{ refreshing }}" bind:scroll="handleScroll" bind:scrolltolower="onScrollToLower" bind:refresherpulling="onPulling" bind:refresherrefresh="onRefresh" bind:refresherrestore="onRestore" bind:refresherabort="onAbort" > <view slot="refresher" class="refresher-placeholder"> <view class="tips">{{ refresherTip }}</view> <view class="icon {{ refreshing ? 'refreshing' : '' }}" style="transform: rotate({{ iconRotate }}deg)"></view> </view> <slot></slot> </scroll-view> 我在onRefresh里设置了5秒后把refreshing改为false,当我下拉距离刚好或者略微超出refresherThreshold值的时候,无论refreshing是true还是false,永远都是先触发onRefresh,然后立刻触发onRestore。 只有下拉距离超出refresherThreshold值比较多的时候,才会先触发onRefresh,5秒后再触发onRestore。 这是什么毛病?
04-02 - 如何引入第三方库的子目录?
import dayjs from 'dayjs' import weekday from 'dayjs/plugin/weekday' 引入dayjs没问题,但是引入dayjs/plugin/weekday会报错:Error: module 'pages/calendar/dayjs/plugin/weekday.js' is not defined, require args is 'dayjs/plugin/weekday' 目测是开发工具把这个当成引入相对于当前页面路径的文件了,要怎么做才能正确引入 node_modules/dayjs/plugin/weekday ?
03-20