Appearance
head-portrait 头像组件
head-portrait 是一个头像展示与更换组件,支持查看大图和裁剪上传。
基础用法
vue
<template>
<head-portrait
:value="avatarUrl"
:save="onSave"
>
</head-portrait>
</template>
<script>
export default {
data() {
return {
avatarUrl: ''
}
},
methods: {
onSave() {
// 保存回调
}
}
}
</script>Props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| value | 头像图片 URL | String | '' |
| save | 保存回调函数 | Function | () => {} |