# Avatar头像裁剪

用于裁剪头像

# 基本使用

 <template>
 	<view class="pd-20">
 		<view class="flex y-center border-bottom pdb-10">
 			<view class="fill-all">
 				头像
 			</view>
 			<com-avatar @upload="uploadAvatar" :avatarSrc="url"></com-avatar>
 		</view>
 	</view>
 </template>
 
 <script>
 	export default {
 		
 		data(){
 			return {
 				url: ""
 			}
 		},
 		
 		methods:{
 			
 			// 裁切后上传路径
 			uploadAvatar(e){
 				this.url = e.path //裁切后路径
 				
 				// 上传操作
 				
 				// 上传后赋值
 				this.url = e.path
 			}
 		}
 	}
 </script>

# API

# Props

属性名 说明 类型 必填 默认值
avatarSrc 头像显示路径 String true

# Events

事件 说明 回调参数
upload 点击上传时触发 { path: '裁剪后的图片本地路径' }
上次更新时间: 11/8/2022, 11:23:27 PM