v3.0.6
This commit is contained in:
32
source/wx/xzs-student/component/iView/index-item/index.js
Normal file
32
source/wx/xzs-student/component/iView/index-item/index.js
Normal file
@@ -0,0 +1,32 @@
|
||||
Component({
|
||||
externalClasses: ['i-class'],
|
||||
properties : {
|
||||
name : {
|
||||
type : String,
|
||||
value : ''
|
||||
}
|
||||
},
|
||||
relations : {
|
||||
'../index/index' : {
|
||||
type : 'parent'
|
||||
}
|
||||
},
|
||||
data : {
|
||||
top : 0,
|
||||
height : 0,
|
||||
currentName : ''
|
||||
},
|
||||
methods: {
|
||||
updateDataChange() {
|
||||
const className = '.i-index-item';
|
||||
const query = wx.createSelectorQuery().in(this);
|
||||
query.select( className ).boundingClientRect((res)=>{
|
||||
this.setData({
|
||||
top : res.top,
|
||||
height : res.height,
|
||||
currentName : this.data.name
|
||||
})
|
||||
}).exec()
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
11
source/wx/xzs-student/component/iView/index-item/index.wxml
Normal file
11
source/wx/xzs-student/component/iView/index-item/index.wxml
Normal file
@@ -0,0 +1,11 @@
|
||||
<view class="i-index-item i-class">
|
||||
<view class="i-index-item-header">{{name}}</view>
|
||||
<view class="i-index-item-content">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
<wxs module="parse">
|
||||
module.exports = {
|
||||
|
||||
}
|
||||
</wxs>
|
||||
@@ -0,0 +1 @@
|
||||
.i-index-item-header{height:30px;line-height:30px;background:#eee;font-size:14px;padding-left:10px;width:100%;box-sizing:border-box}.i-index-item-content{font-size:14px}
|
||||
Reference in New Issue
Block a user