我如何在vuetify的模式对话框中垂直添加滚动条?

问题描述 投票:1回答:1

我的代码是这样的:

<div id="app">
  <v-app>
    <v-content>
      <v-container>
        <v-dialog
            v-for='foo, k in foos' :key='foo.id'
            :close-on-content-click="false"
            transition="scale-transition"
            :return-value.sync="foo.date"
            min-width="290px" 
            v-model="modal[k]"
            :ref="'dialog' + k"
        >
            <template v-slot:activator="{ on }">
                <v-btn color="success" dark v-on="on">call date {{foo.id}} {{ foo.date }}</v-btn>
            </template>

            <v-row justify="center">
            <v-date-picker v-model="foo.date" @input="changeHours">
                <div class="flex-grow-1"></div>
                <v-btn text color="primary" @click="modal[k] = false">Cancel</v-btn>
                <v-btn text color="primary" @click="$refs['dialog' + k][0].save(foo.date)">OK</v-btn>
            </v-date-picker>
            <v-slide-y-transition>
            <v-col cols=2 v-show="foo.date !== null"  :style="{'background-color':'white'}">
              <template v-for="allowedTime in allowedTimes">
                <v-btn
                  @click="setTime(allowedTime)"
                  class="my-2"
                  :outlined="allowedTime !== time"
                  block
                  x-large
                  color="primary"
                >{{ allowedTime }}</v-btn>
              </template>
            </v-col>
            </v-slide-y-transition>
            </v-row>
        </v-dialog>    
      </v-container>
    </v-content>
  </v-app>
</div>

演示就是这样:

https://codepen.io/positivethinking639/pen/YzzwYZq

我希望有很多时间,滚动条会自动出现在模式对话框中

我该怎么办?

vue.js datepicker modal-dialog vue-component vuetify.js
1个回答
0
投票
在v-dialog内部的内容区域周围添加了v-flex包装器,然后设置行的宽度限制以进行限制,现在它按预期方式工作了>>

添加CSS

.row { margin-right: 0 !important; }

© www.soinside.com 2019 - 2024. All rights reserved.