Vue3 中可以使用指令来封装一个横向滚动条。可以使用 v-bind:style 来设置 overflow-x 属性为 'scroll',这样可以在不显示滚动条的情况下进行手动滚动。
举例:
<template>
<div v-bind:style="{'overflow-x': 'scroll'}">
<div v-for="item in items" :key="item.id">{{ item.name }}</div>
</div>
</template>
<script>
export default {
data() {
return {