优化组件/更新
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<text class="arrow down" :class="{ active: descending }" @click.stop="descendingFn"></text>
|
||||
</view>
|
||||
</view>
|
||||
<dropdown v-if="filterType || filterData.length" :filterData="filterData" :filterType="filterType" @change="ondropdown"></dropdown>
|
||||
<dropdown v-if="filterType || filterData.length" :filterDefaultValue="filterDefaultValue" :filterData="filterData" :filterType="filterType" @change="ondropdown"></dropdown>
|
||||
</view>
|
||||
</th>
|
||||
<!-- #endif -->
|
||||
@@ -41,7 +41,12 @@
|
||||
export default {
|
||||
name: 'uniTh',
|
||||
options: {
|
||||
// #ifdef MP-TOUTIAO
|
||||
virtualHost: false,
|
||||
// #endif
|
||||
// #ifndef MP-TOUTIAO
|
||||
virtualHost: true
|
||||
// #endif
|
||||
},
|
||||
components: {
|
||||
// #ifdef H5
|
||||
@@ -79,6 +84,12 @@ export default {
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
filterDefaultValue: {
|
||||
type: [Array,String],
|
||||
default () {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -101,7 +112,12 @@ export default {
|
||||
return this.width.replace('px', '')
|
||||
} else if (this.width.match(regexHaveUnitRpx) !== null) { // 携带了 rpx
|
||||
let numberRpx = Number(this.width.replace('rpx', ''))
|
||||
// #ifdef MP-WEIXIN
|
||||
let widthCoe = uni.getWindowInfo().screenWidth / 750
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
let widthCoe = uni.getSystemInfoSync().screenWidth / 750
|
||||
// #endif
|
||||
return Math.round(numberRpx * widthCoe)
|
||||
} else if (this.width.match(regexHaveNotUnit) !== null) { // 未携带 rpx或px 的纯数字 String
|
||||
return this.width
|
||||
@@ -200,6 +216,7 @@ export default {
|
||||
|
||||
<style lang="scss">
|
||||
$border-color: #ebeef5;
|
||||
$uni-primary: #007aff !default;
|
||||
|
||||
.uni-table-th {
|
||||
padding: 12px 10px;
|
||||
@@ -254,7 +271,7 @@ $border-color: #ebeef5;
|
||||
}
|
||||
&.active {
|
||||
::after {
|
||||
background-color: #007aff;
|
||||
background-color: $uni-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,7 +288,7 @@ $border-color: #ebeef5;
|
||||
}
|
||||
&.active {
|
||||
::after {
|
||||
background-color: #007aff;
|
||||
background-color: $uni-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user