Comments (10)
from kbone.
那扩展库版本太旧导致头像填写能力的问题麻烦更新下哈 上次一个维护的老师是直接给我element,和render那两个文件包让我直接放到我本地中 但是这个太占项目空间了
from kbone.
那扩展库版本太旧导致头像填写能力的问题麻烦更新下哈 上次一个维护的老师是直接给我element,和render那两个文件包让我直接放到我本地中 但是这个太占项目空间了
请问下这个扩展库更新了么
from kbone.
扩展库更新问题正在处理
from kbone.
kbone 本身无法支持标准的 preventDefault,因为小程序的双线程架构,事件是异步来到逻辑层的,此时逻辑层想要去阻止视图层的事件势必会滞后,所以小程序本身也没支持这个能力,因此 kbone 也无法完全兼容。kbone 提供的 preventDefault 只能做到阻止点击跳转等可以监管的事件。
如果要实现阻止外层滚动之类的,可以使用 wx-catch 等,他会将事件绑定使用 catchbind 来处理:
from kbone.
感谢大佬及时解惑,那就是说如果kbone中 利用 touchmove 和 toustart ,touchend 无法做到和小程序的轮播效果一样对么 ?
因为我swipe-item中会有点击事件,如果使用wx-catch的话 在touchmove的时候 就不能使整个bodyY轴移动了。
我现在使用的是wx-capture ,但是我移动沿着X轴触发touchmove的时候 body的Y轴也在滚动
而且现在我移动的时候 是使用translate3D改变当前swipe-item X轴位置 安卓机会很卡,ios就比较流畅
from kbone.
这个倒不是完全做不到,得看具体场景,如果需要按需控制外层是否可以滚动的话(或使用 preventDefault),目前是做不到。如果没有特殊需求的话,可以直接把自实现 swiper 外层直接用 wx-catch 给包住,这样事件就不会漏到外面去了,外面也就响应不到自实现 swiper 里面的手势。而小程序内置的 swiper 是直接实现在视图层,所以可以做到阻止默认事件,所以如果没有特殊需求的话,其实比较建议直接用小程序内置的 swiper 来实现。
至于卡顿的问题你这里应该是有频繁的更新?如果有的话,针对频繁更新的节点可以都放在一个 wx-view 里面: https://wechat-miniprogram.github.io/kbone/docs/guide/optimize.html#%E5%A4%84%E7%90%86%E9%A2%91%E7%B9%81%E6%9B%B4%E6%96%B0%E7%9A%84-dom-%E8%8A%82%E7%82%B9
( 还有一种方案是直接用原生的 wxs 来做,wxs 可以做到直接在视图层修改页面节点:https://developers.weixin.qq.com/miniprogram/dev/framework/view/interactive-animation.html ,而 kbone 也支持使用小程序的自定义组件,所以可以直接将整个自实现的 swiper 用做成原生的自定义组件,然后 kbone 来接入使用:https://wechat-miniprogram.github.io/kbone/docs/guide/advanced.html#%E4%BD%BF%E7%94%A8%E5%B0%8F%E7%A8%8B%E5%BA%8F%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BB%84%E4%BB%B6 ,理论上来说,大部分原生能做但 kbone 做不了的,都可以用这个方式来兜底 )
from kbone.
辛苦大佬细心的解答 第一种 第二种我这边可以再尝试下(按需控制外层是否可以滚动估计还是做不到),但是第三种有一个弊端 就是自定义组件他会默认放到主包里面,可以放到我指定的分包么
from kbone.
第三种想放分包倒不是不行,只是需要绕一下,你可以把真正复杂逻辑的组件放到分包,然后主包这里留一个 wrapper 自定义组件给 kbone 用。而主包这个 wrapper 自定义组件可以通过分包异步化这个特性来使用任意分包的自定义组件:https://developers.weixin.qq.com/miniprogram/dev/framework/subpackages/async.html
相当于主包做个没有具体业务逻辑的管理组件,根据你需要使用不同分包的自定义组件即可。
from kbone.
谢谢大佬指点
from kbone.
Related Issues (20)
- build mp - 小程序开发工具预览失败 HOT 1
- ios真机调试报错 selector = selector.replace(regexp, onProcess) HOT 1
- npm run build,h5空白 HOT 1
- vue-cli-plugin-kbone 是不是不支持webpack5项目 HOT 2
- kbone页面节点1000左右的时候,小程序就会变卡顿吗,即使没有在setData,滑动都感觉不流畅 HOT 11
- wx-input 组件 触发input 事件的时候,没监听事件返回值,以及不会同步外部value的值。 HOT 2
- 【讨论】新的小程序组件框架 glass-easel HOT 1
- wx-button open-type="agreePrivacyAuthorization" 回调无法触发 HOT 4
- -
- 是否可以支持 Construct 3 引擎? HOT 3
- createIntersectionObserver().relativeToViewport().observe() 问题 HOT 9
- npm install的时候报错,依赖冲突了 HOT 1
- 'rimraf' 不是内部或外部命令,也不是可运行的程序 HOT 1
- kbone递归方案 HOT 1
- 使用window.$$createIntersectionObserver()页面报错异常错误
- 组件属性对齐:input 组件 auto-focus 即将弃用,需要使用 focus 替代 HOT 1
- img xhr 列表下的img的src在init的时候会把所有的图片都通过xhrget一遍,在图片列表较大的时候很影响 HOT 10
- 请问在vue3项目中使用kbone-ui的mp-navigation-bar组件时,如何绑定bindback事件? HOT 3
- 小程序内嵌视频号视频,无法加载到wx-channel-video组件 HOT 11
- 瓦片地图【image】标签在图片较大时(100k左右)在真机环境不显示 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kbone.