123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <template>
- <view class="second-class dir-left-nowrap">
- <view class="spring-board" v-if="switchBool">
- <view class="ollapse main-right" @click="switchBool = false">
- <image src="./image/ollapse.png" class="ollapse-icon"></image>
- </view>
- <view class="ollapse-view">
- <text class="item" v-for="(it, key) in list" :key="key" :class="key === activeIndexTwo ? 'active ' + theme+ '-m-text ' + theme: ''" @click="setNav(it, key)">
- {{it.name}}
- </text>
- </view>
- </view>
- <scroll-view scroll-x
- v-if="!switchBool"
- class="left dir-left-nowrap"
- >
- <view>
- <text class="item " v-for="(it, key) in list" :key="key" :class="key === activeIndexTwo ? 'active ' + theme+ '-m-text ' + theme: ''" @click="setNav(it, key)">
- {{it.name}}
- </text>
- </view>
- </scroll-view>
- <view class="right" v-if="!switchBool" @click="switchBool = true">
- <image src="./image/expand.png" class="icon"></image>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "second-class",
- props: ['list', `activeIndexTwo`, `theme`],
- data() {
- return {
- switchBool: false
- }
- },
- methods: {
- setNav(it, key) {
- this.$emit('setNav',it, key);
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .second-class {
- position: relative;
- height: #{106upx};
- width: #{528upx};
- background-color: #ffffff;
- }
- .left {
- width: #{448upx};
- white-space: nowrap;
- vertical-align: center;
- background-color: #ffffff;
- line-height: #{106upx};
- }
- .right {
- width: #{80upx};
- height: #{106upx};
- position: relative;
- box-shadow: #{-1upx 0 5upx -5upx} rgba(0, 0, 0, .2);
- }
- .item {
- display: inline-block;
- font-size: #{24upx};
- height: #{54upx};
- line-height: #{54upx};
- padding: #{0 20upx};
- border: #{1upx} solid #cccccc;
- border-radius: #{34upx};
- margin-right: #{16upx};
- }
- .icon {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- width: #{56upx};
- height: #{56upx};
- }
- .ollapse {
- height: #{106upx};
- width: #{528upx};
- position: relative;
- }
- .ollapse-icon {
- position: absolute;
- top: 50%;
- right: #{12upx};
- width: #{56upx};
- height: #{56upx};
- transform: translateY(-50%);
- }
- .ollapse-view > text {
- margin-bottom: #{20upx};
- }
- .spring-board {
- position: absolute;
- top: 0;
- left: 0;
- width: #{528upx};
- z-index: 1000;
- background-color: #ffffff;
- }
- .active {
- border: #{1rpx} solid;
- }
- </style>
|