步骤:完整代码如下
<template>
<div>
<div class="box">
<div v-for="(item,i) in 4" :key="item"></div>
</div>
</div>
</template>
<style scoped lang="scss">
.box{
width:375px;
border: 1px solid red;
height: 200px;
display: flex;
display: -webkit-box;
white-space: nowrap;
overflow: hidden;
overflow-x: initial;
>div{
width: 200px;
height: 100%;
}
>:nth-child(1){
background:blue;
}
>:nth-child(2){
background:pink;
}
>:nth-child(3){
background:green;
}
>:nth-child(4){
background:#007AFF;
}
}
</style>