![](https://img-blog.csdnimg.cn/20190927151043371.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
小程序专栏
关于微信小程序与taro小程序使用汇总
方形裤子的黄方块
这个作者很懒,什么都没留下…
展开
-
出现TypeError: Cannot assign to read only property ‘jsx‘ of object ‘#‘
项目组一开始使用yarn 命令安装模块,后来改换为npm,一换就出问题了,一直报下面的问题。删除node_modules 包也没用。TypeError: Cannot assign to read only property 'jsx' of object '#<Object>' at verifyTypeScriptSetup (/Users/Nathan/Projects/pwa/pwa-react/pwa-react/node_modules/react-scripts/scr原创 2021-07-02 10:46:27 · 1204 阅读 · 3 评论 -
小程序苹果手机底部出现横杠处理
iphone X 手机底部会出现横杠,会影响底部的操作,可以通过判断是否是对应机型,进行不同样式的设置Taro.getSystemInfoSync() 获取系统信息同步接口。官网说明:https://taro-docs.jd.com/taro/docs/apis/base/system/getSystemInfoSync示例代码:try { const res = Taro.getSystemInfoSync() console.log(res.model) // 设备型号 cons原创 2021-07-01 18:01:35 · 1658 阅读 · 0 评论 -
Canvas 转化成图片
Canvas 转化成图片使用canvasToTempFilePathApi例如: // 生成图片,获取临时路径(得到之后,想干嘛就干嘛了) wx.canvasToTempFilePath({ canvasId: 'myQrcode', canvas: canvas, x: 0, y: 0, width: 260, // 图片指定宽高 height: 260, destWidt原创 2021-06-30 18:27:27 · 859 阅读 · 0 评论 -
Taro小程序如何引入微信原生小程序
在根路径中找到 app.config.ts 文件在里面的属性中定义需要引入的第三方组件如: usingComponents: { // 定义需要引入的第三方组件,如: 'wux-calendar': './components/Calendar/index', myQrcode: './components/TestQrcode/index', },之后在页面中直接使用即可如: <View> <wux-calendar id="原创 2021-06-30 18:15:20 · 1788 阅读 · 0 评论 -
createSelectorQuery获取对象为null
wx.createSelectorQuery().in(this).select(’#’ + id);Taro小程序同理 const query = wx.createSelectorQuery().in(this); query .select(`#${id}`) .fields({ node: true, size: true, }) .exec((res) => { .原创 2021-06-30 18:12:27 · 2206 阅读 · 0 评论 -
Taro 小程序,拖拽图标功能
由 MovableArea 和 MovableView 进行书写Taro官方事例 MovableAreaTaro官方事例 MovableView具体的props 按文档上的来代码事例 <MovableArea className="home-page_move" style={{ height: 200px }}> <MovableView y="340px" x={xWidth}原创 2021-04-29 18:13:41 · 700 阅读 · 1 评论 -
微信小程序生成canvas-2d类型的二维码
canvas画布。2.9.0 起支持一套新 Canvas 2D 接口(需指定 type 属性),同时支持同层渲染,原有接口不再维护。在目前版本中,如果使用旧canvas,开发者工具也会提示切换为canvas 2d 渲染效率更高git用户 DoctorWei基于 weapp-qrcode 修改成canvas 2d写法。下面介绍如何使用:1、先在 wxml 文件中,创建绘制的 canvas,并定义好 width, height, id , type ,其中type的值必须为2d<canvas ty原创 2021-06-30 17:40:36 · 1348 阅读 · 3 评论 -
CSS 文本超过部分显示省略号,解决数字或英文不换行问题
1、单行文本.Text{ //记得一定要给div宽度 width:200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}2、多行文本.moreText{ //记得一定要给div宽度 width:200px; white-space: normal; overflow: hidden; text-overflow: ellipsis; display: -原创 2021-04-29 18:16:04 · 664 阅读 · 0 评论 -
微信小程序完全去除button默认样式
button{background-color:rgb(247, 247, 247); //可根据自己的背景颜色自行设置border-radius: 0rpx;padding:0rpx;margin:0rpx;display: inline-block;line-height: 1;}button::after{ /*button的边框样式是通过::after方式实现的*/border:none;}.button-hover{ /*点击后样式*/color:#000;back.原创 2021-04-29 18:15:05 · 1317 阅读 · 0 评论