小程序源码
This commit is contained in:
20
source/wx/xzs-student/component/iView/avatar/index.js
Normal file
20
source/wx/xzs-student/component/iView/avatar/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
Component({
|
||||
externalClasses: ['i-class'],
|
||||
|
||||
properties: {
|
||||
// circle || square
|
||||
shape: {
|
||||
type: String,
|
||||
value: 'circle'
|
||||
},
|
||||
// small || large || default
|
||||
size: {
|
||||
type: String,
|
||||
value: 'default'
|
||||
},
|
||||
src: {
|
||||
type: String,
|
||||
value: ''
|
||||
}
|
||||
}
|
||||
});
|
||||
3
source/wx/xzs-student/component/iView/avatar/index.json
Normal file
3
source/wx/xzs-student/component/iView/avatar/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
4
source/wx/xzs-student/component/iView/avatar/index.wxml
Normal file
4
source/wx/xzs-student/component/iView/avatar/index.wxml
Normal file
@@ -0,0 +1,4 @@
|
||||
<view class="i-class i-avatar i-avatar-{{ shape }} i-avatar-{{ size }} {{ src ? 'i-avatar-image' : '' }}">
|
||||
<image src="{{ src }}" wx:if="{{ src !== '' }}"></image>
|
||||
<view class="i-avatar-string" wx:else><slot></slot></view>
|
||||
</view>
|
||||
1
source/wx/xzs-student/component/iView/avatar/index.wxss
Normal file
1
source/wx/xzs-student/component/iView/avatar/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
.i-avatar{display:inline-block;text-align:center;background:#ccc;color:#fff;white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;width:32px;height:32px;line-height:32px;border-radius:16px;font-size:18px}.i-avatar .ivu-avatar-string{line-height:32px}.i-avatar-large{width:40px;height:40px;line-height:40px;border-radius:20px;font-size:24px}.i-avatar-large .ivu-avatar-string{line-height:40px}.i-avatar-small{width:24px;height:24px;line-height:24px;border-radius:12px;font-size:14px}.i-avatar-small .ivu-avatar-string{line-height:24px}.i-avatar-image{background:0 0}.i-avatar-square{border-radius:4px}.i-avatar>image{width:100%;height:100%}
|
||||
Reference in New Issue
Block a user