UNPKG

@qiniu/miku-delivery-mp-ks

Version:

Kuaishou Mini Program SDK for Miku Delivery

52 lines (31 loc) 2.52 kB
# 不同小程序平台的能力/行为差异 ### 虚拟化组件节点 https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html#%E8%99%9A%E6%8B%9F%E5%8C%96%E7%BB%84%E4%BB%B6%E8%8A%82%E7%82%B9 * 微信:支持 * 抖音:不支持 * 快手:不支持 ### 组件 `:host` 样式 https://mp.kuaishou.com/docs/develop/frame/custom_comp/component_temp_style.html#%E7%BB%84%E4%BB%B6%E6%A0%B7%E5%BC%8F * 微信:不支持 * 抖音:不支持 * 快手:支持 ### Video 自动加载(metadata) 表现为给 `<video>` 设置 `src` 后会自动触发 `loadedmetadata` 事件 * 微信:加载 * 抖音:开发者工具里不加载,真机会加载 * 快手:`video` 没有 `loadedmetadata` 事件 ### 预加载视频 https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/api/media/video/tt-preload-video * 微信:不支持 * 抖音:支持 * 快手:不支持 ### 与自定义组件通信(获取自定义组件的实例) * 微信:[selectComponent](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/events.html#%E8%8E%B7%E5%8F%96%E7%BB%84%E4%BB%B6%E5%AE%9E%E4%BE%8B),[支持自定义 export](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/events.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E7%9A%84%E7%BB%84%E4%BB%B6%E5%AE%9E%E4%BE%8B%E8%8E%B7%E5%8F%96%E7%BB%93%E6%9E%9C) * 抖音:[ref 获取](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/guide/developing-and-testing-miniApp/front-end/mini-app-framework/custom-component/ref/) * 快手:selectComponent,号称支持[自定义 export](https://mp.kuaishou.com/docs/develop/frame/custom_comp/behaviors.html#ks-component-export),实测不支持(外部通过 `selectComponent` 得到的还是组件实例,而不是自定义的导出) ### 通过 npm 安装自定义组件 * 微信:支持,对格式有[要求](https://developers.weixin.qq.com/miniprogram/dev/devtools/npm.html#%E5%8F%91%E5%B8%83%E5%B0%8F%E7%A8%8B%E5%BA%8F-npm-%E5%8C%85%E7%9A%84%E7%BA%A6%E6%9D%9F) * 抖音:(号称)支持,对格式有[要求](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/framework/npm/#_%E5%BC%80%E5%8F%91-npm),但是无法跑通,没定位到问题原因 * 快手:不支持,见[开发者社区帖子](https://developers.kuaishou.com/topic?tid=4402&bizType=miniprogram&tag=1652875043464) ### 其他 API 差异`wx.request` vs `tt.request``wx.getStorage` vs `tt.getStorage`