template-project/components/scroll-views/scroll-text.vue

45 lines
927 B
Vue
Raw Normal View History

<template>
<scroll-view scroll-x>
<view :class="dataList.length == 4 ? 'disjbac' : 'disac'">
<view @tap="switchType(item.id)" class="flexs" v-for="(item,index) in dataList" :key="index" style="width: 23%;" :style="{marginRight: dataList.length != 4 ? '20rpx' : ''}">
<view class="fon28 clips1">{{item.title}}</view>
</view>
</view>
</scroll-view>
</template>
<script>
export default {
name:"scroll-text",
props:{
dataList:{
type:Array,
default:()=>{
return [
{id:1,title:'控制室解决方案'},
{id:2,title:'户外屏解决方案'},
{id:3,title:'会议室解决方案'},
{id:4,title:'实体店解决方案'},
{id:5,title:'实体店解决方案'},
{id:6,title:'实体店解决方案'},
]
}
}
},
data() {
return {
};
},
methods:{
switchType(id) {
this.$emit('changeEv',id);
}
}
}
</script>
<style>
</style>