You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
956 B
Vue
67 lines
956 B
Vue
<template>
|
|
<view
|
|
:style="{
|
|
'padding':pad + 'px',
|
|
'background-color':bg,
|
|
}"
|
|
:class="'g_radius_' + radius"
|
|
>
|
|
<image :src="url ? url : localBaseImg + 'default.svg'"
|
|
:class="'g_radius_' + radius"
|
|
mode="aspectFill"
|
|
|
|
:style="{
|
|
'width':(size / 2) + 'px',
|
|
'height':(size / 2) + 'px',
|
|
}"
|
|
@click="handleClick"
|
|
></image>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
/* 默认头像
|
|
* @params url 图片路径
|
|
* @params size 尺寸
|
|
* @params radius 圆度值
|
|
*/
|
|
export default{
|
|
data(){
|
|
return{
|
|
localBaseImg:this.G.store().localBaseImg,
|
|
}
|
|
},
|
|
props:{
|
|
url:{
|
|
type:String,
|
|
default(){
|
|
return '';
|
|
}
|
|
},
|
|
size:{
|
|
default(){
|
|
return 48;
|
|
}
|
|
},
|
|
radius:{
|
|
default(){
|
|
return 50;
|
|
}
|
|
},
|
|
pad:{
|
|
default:0
|
|
},
|
|
bg:{
|
|
default:'none'
|
|
}
|
|
},
|
|
methods:{
|
|
handleClick(){
|
|
this.$emit('clickItem')
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
</style> |