更新记录
1.0.8(2025-02-20) 下载此版本
去掉组件中无用代码
1.0.7(2025-02-19) 下载此版本
自动依赖uni-icons
1.0.6(2025-02-19) 下载此版本
更新说明文档
查看更多平台兼容性
Vue2 | Vue3 |
---|---|
√ | √ |
App | 快应用 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ小程序 |
---|---|---|---|---|---|---|
HBuilderX 3.8.12 app-vue app-nvue | √ | √ | √ | √ | √ | √ |
钉钉小程序 | 快手小程序 | 飞书小程序 | 京东小程序 | 鸿蒙元服务 |
---|---|---|---|---|
√ | √ | √ | √ | × |
H5-Safari | Android Browser | 微信浏览器(Android) | QQ浏览器(Android) | Chrome | IE | Edge | Firefox | PC-Safari |
---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | √ | √ | √ | √ | √ |
图标依赖
此组件中操作按钮的图标,依赖官方插件uni-icons,已自动依赖引入官方图标插件uni-icons
引用样例
<template>
<view class="container">
<vrapile-cut-image :avatar="imageSrc" @save="save"></vrapile-cut-image>
</view>
</template>
<script>
// import { uploadAvatar } from "@/api/system/user"
export default {
data() {
return {
imageSrc: "",
}
},
created() {
// 初始化一个图片地址
this.imageSrc = "https://minio.ninecloud.top/prod/2024/08/05/67a593d2c2f24f188163b4712100c227.jpg";
},
methods: {
save(e){
console.log(e.avatar)
// uploadAvatar({
// filePath: e.avatar,
// })
},
}
}
</script>
功能说明
-
入参 avatar :非必传,可传一个初始的图片地址,可以是网络图片地址,也可以是本地图片路径
注:微信小程序在初始化时只支持 https 的地址
-
回调函数 save :内容是Json格式,其中avatar的值是裁剪后图片,格式为 data:image/png;base64,
其它
关联组件:支持多种操作的图片裁剪组件(components版)
演示Demo: https://www.ninecloud.top/udemo/cut-image/index.html
演示微信小程序:

篮球共享计分器(账号/密码:visitor/visitor)