feat:设备使用记录
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* @Author : LQ
|
||||
* @Description :
|
||||
* @version : 1.0
|
||||
* @version : 3.0
|
||||
* @Date : 2021-08-20 16:44:21
|
||||
* @LastAuthor : LQ
|
||||
* @lastTime : 2021-08-20 17:13:15
|
||||
* @FilePath : /u-view2.0/uview-ui/libs/config/props/indexAnchor.js
|
||||
* @LastAuthor : jry
|
||||
* @lastTime : 2025-12-19 08:55:21
|
||||
* @FilePath : /uview-plus/libs/config/props/indexAnchor.js
|
||||
*/
|
||||
export default {
|
||||
// indexAnchor 组件
|
||||
@@ -13,7 +13,7 @@ export default {
|
||||
text: '',
|
||||
color: '#606266',
|
||||
size: 14,
|
||||
bgColor: '#dedede',
|
||||
bgColor: '#f1f1f1',
|
||||
height: 32
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<!-- #endif -->
|
||||
<view
|
||||
class="u-index-anchor u-border-bottom"
|
||||
:class="{ 'u-index-anchor--sticky': parentSticky }"
|
||||
:ref="`u-index-anchor-${text}`"
|
||||
:style="{
|
||||
height: addUnit(height),
|
||||
@@ -16,7 +17,7 @@
|
||||
fontSize: addUnit(size),
|
||||
color: color
|
||||
}"
|
||||
>{{ text }}</text>
|
||||
>{{ text.name || text }}</text>
|
||||
</view>
|
||||
<!-- #ifdef APP-NVUE -->
|
||||
</header>
|
||||
@@ -69,15 +70,24 @@
|
||||
return error('u-index-anchor必须要搭配u-index-item组件使用')
|
||||
}
|
||||
// 设置u-index-item的id为anchor的text标识符,因为非nvue下滚动列表需要依赖scroll-view滚动到元素的特性
|
||||
indexListItem.id = this.text.charCodeAt(0)
|
||||
if (typeof this.text == 'string') {
|
||||
indexListItem.id = this.text.charCodeAt(0)
|
||||
} else {
|
||||
indexListItem.id = this.text.name.charCodeAt(0)
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
parentSticky() {
|
||||
const indexList = $parent.call(this, "u-index-list");
|
||||
return indexList ? indexList.sticky : true;
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "../../libs/css/components.scss";
|
||||
|
||||
.u-index-anchor {
|
||||
position: sticky;
|
||||
@@ -87,6 +97,11 @@
|
||||
padding-left: 15px;
|
||||
z-index: 1;
|
||||
|
||||
&--sticky {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
&__text {
|
||||
@include flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user