You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
2 days ago | |
---|---|---|
.. | ||
components/vrapile-cut-image | 2 days ago | |
changelog.md | 2 days ago | |
package.json | 2 days ago | |
readme.md | 2 days ago |
readme.md
图标依赖
此组件中操作按钮的图标,依赖官方插件 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版)
演示说明
以下所有工程共用一个后端,账号互通 ( 皆可用访客账号/密码:visitor/visitor )
演示Demo: https://www.ninecloud.top/udemo/cut-image/index.html
演示微信小程序:篮球共享计分器
