123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <template>
- <view class="avatar-image">
- <image class="image"
- :style="{ width: `${width}rpx`, height: `${width}rpx`, borderWidth: `${borderWidth}rpx`, borderColor: borderColor }"
- :src="url ? url : '/static/default-avatar.png'"></image>
- </view>
- </template>
- <script>
- export default {
- /**
- * 组件的属性列表
- * 用于组件自定义设置
- */
- props: {
- url: {
- type: String,
- default: ''
- },
- width: {
- type: Number,
- default: 90
- },
- borderWidth: {
- type: Number,
- default: 0
- },
- borderColor: {
- type: String,
- default: '#000000'
- }
- },
- data() {
- return {
- }
- },
- methods: {
- }
- }
- </script>
- <style lang="scss" scoped>
- .avatar-image {
- .image {
- display: block;
- width: 60rpx;
- height: 60rpx;
- border-radius: 50%;
- border-style: solid;
- }
- }
- </style>
|