You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
653 B
42 lines
653 B
<template> |
|
<view class="sideSelect"> |
|
<view v-for="(item, i) in menus" :key="i" :class="['item', {active: cur === item.id }]" @click="menuChange(item)">{{ item.name }}</view> |
|
</view> |
|
</template> |
|
|
|
<script> |
|
export default { |
|
name:"sideSelect", |
|
props: { |
|
menus: { |
|
type: Array, |
|
default: () => [] |
|
}, |
|
}, |
|
data() { |
|
return { |
|
cur: '' |
|
}; |
|
}, |
|
methods: { |
|
menuChange(item) { |
|
this.cur = item.id |
|
} |
|
} |
|
} |
|
</script> |
|
|
|
<style scoped lang="scss"> |
|
.sideSelect { |
|
min-width: 200rpx; |
|
font-size: 28rpx; |
|
text-align: center; |
|
.item { |
|
padding: 20rpx 0; |
|
} |
|
.active { |
|
color: #fff; |
|
background-color: $uni-primary; |
|
} |
|
} |
|
</style> |