123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <template>
- <view style="overflow-x: auto;" class="scroll">
- <view @click="cutItem(item,index)" class="scroll-item" v-for="(item,index) in list" :key="index">
- <view class="">
- {{item.title}}
- </view>
- <view class="">
- </view>
- <view v-if="item.enrol_year == active" class="scroll-item-color">
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "viewScroll",
- props: {
- list: {
- type: Array,
- default: () => []
- },
- show: {
- type: Boolean,
- default: () => false
- },
- active:{
-
- }
- },
- data() {
- return {
-
- };
- },
- methods: {
- cutItem(item, index) {
-
- this.$emit('click',item)
- }
- },
- mounted() {
-
- }
- }
- </script>
- <style lang="scss" scoped>
- .scroll {
- width: 100%;
- height: 140rpx;
- background-color: #fff;
- display: flex;
- overflow-x: auto;
- position: relative;
- .scroll-text {
- position: absolute;
- left: 0;
- height: 100%;
- display: flex;
- width: 100%;
- color: #fff;
- .scroll-text-left {
- width: 222rpx;
- }
- .scroll-text-right {
- flex: 1;
- background-color: rgba(183, 183, 183, 0.92);
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
- }
- .scroll-item {
- display: flex;
- flex-direction: column;
- flex-shrink: 0;
- width: 222rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- position: relative;
- .scroll-item-color {
- position: absolute;
- bottom: 10rpx;
- left: 50%;
- transform: translate(-50%, 0);
- width: 150rpx;
- height: 6rpx;
- background-color: rgba(5, 204, 161, 1);
- }
- }
- }
- </style>
|