Skip to content

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头像图片 URLString''
save保存回调函数Function() => {}