v3.4.0
This commit is contained in:
42
source/wx/exam-student/component/iView/page/index.js
Normal file
42
source/wx/exam-student/component/iView/page/index.js
Normal file
@@ -0,0 +1,42 @@
|
||||
Component({
|
||||
externalClasses: ['i-class'],
|
||||
|
||||
options: {
|
||||
multipleSlots: true
|
||||
},
|
||||
|
||||
properties: {
|
||||
// button || number || pointer
|
||||
mode: {
|
||||
type: String,
|
||||
value: 'button'
|
||||
},
|
||||
current: {
|
||||
type: Number,
|
||||
value: 1
|
||||
},
|
||||
total: {
|
||||
type: Number,
|
||||
value: 0
|
||||
},
|
||||
// 是否隐藏数值
|
||||
simple: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleChange (type) {
|
||||
this.triggerEvent('change', {
|
||||
type: type
|
||||
});
|
||||
},
|
||||
handlePrev () {
|
||||
this.handleChange('prev');
|
||||
},
|
||||
handleNext () {
|
||||
this.handleChange('next');
|
||||
}
|
||||
}
|
||||
});
|
||||
7
source/wx/exam-student/component/iView/page/index.json
Normal file
7
source/wx/exam-student/component/iView/page/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents":
|
||||
{
|
||||
"i-button": "../button/index"
|
||||
}
|
||||
}
|
||||
14
source/wx/exam-student/component/iView/page/index.wxml
Normal file
14
source/wx/exam-student/component/iView/page/index.wxml
Normal file
@@ -0,0 +1,14 @@
|
||||
<view class="i-class i-page">
|
||||
<view class="i-page-prev" wx:if="{{ mode === 'button' }}">
|
||||
<i-button i-class="i-page-button" type="ghost" bindclick="handlePrev" disabled="{{ current === 1 }}"><slot name="prev"></slot></i-button>
|
||||
</view>
|
||||
<view class="i-page-number" wx:if="{{ mode !== 'pointer' && !simple }}">
|
||||
<view class="i-page-number-current">{{ current }}</view>/{{total}}
|
||||
</view>
|
||||
<view class="i-page-pointer" wx:if="{{ mode === 'pointer' }}">
|
||||
<view class="i-page-pointer-dot {{ (index + 1) === current ? 'current' : '' }}" wx:for="{{ total }}" wx:key="index"></view>
|
||||
</view>
|
||||
<view class="i-page-next" wx:if="{{ mode === 'button' }}">
|
||||
<i-button i-class="i-page-button" type="ghost" bindclick="handleNext" disabled="{{ current === total }}"><slot name="next"></slot></i-button>
|
||||
</view>
|
||||
</view>
|
||||
1
source/wx/exam-student/component/iView/page/index.wxss
Normal file
1
source/wx/exam-student/component/iView/page/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
.i-page{display:block;width:100%;height:44px;overflow:hidden;box-sizing:border-box;position:relative}.i-page-prev{position:absolute;left:10px;top:0}.i-page-next{position:absolute;right:10px;top:0}.i-page-number{width:100%;height:44px;line-height:44px;margin:0 auto;text-align:center}.i-page-number-current{display:inline;color:#2d8cf0}.i-page-pointer{width:100%;height:44px;line-height:44px;margin:0 auto;text-align:center}.i-page-pointer-dot{display:inline-block;width:8px;height:8px;margin:0 2px;border-radius:50%;background:#bbbec4}.i-page-pointer-dot.current{background:#80848f}.i-page-button{display:inline-block;margin:0}
|
||||
Reference in New Issue
Block a user