最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Vuetify v-select menu covers text-field input - Stack Overflow

programmeradmin0浏览0评论

I don’t want the menu to cover the input box. My Vuetify version is 2.3.18. How do I fix this?

I found this but it doesn't work for me:

I found a Vuetify github bug:

Vuetify v-select Codepen example:

Vue.use(Vuetify);

var vm = new Vue({
  el: "#app",
  methods: {
  },
  data () {
    return {
      select: { state: 'Florida', abbr: 'FL' },
      hideDetails: false,
      items: [
        { state: 'Florida', abbr: 'FL' },
        { state: 'Georgia', abbr: 'GA' },
        { state: 'Nebraska', abbr: 'NE' },
        { state: 'California', abbr: 'CA' },
        { state: 'New York', abbr: 'NY' }
      ]
    }
  },
});
<script src=".4.3/vue.js"></script>
<script src="/[email protected]/dist/vuetify.min.js"></script>

<link rel=stylesheet type="text/css" href="/[email protected]/dist/vuetify.min.css">

<div id="app">
    <v-app dark>
       <v-select
            v-bind:items="items"
            v-model="select"
            label="Select"
            single-line
            :hide-details="hideDetails"
            hint="Hint of Select"
            item-text="state"
            item-value="abbr"
            return-object
            autoplete
          ></v-select>
    </v-app>
</div>

I don’t want the menu to cover the input box. My Vuetify version is 2.3.18. How do I fix this?

I found this but it doesn't work for me: https://codepen.io/jrast/pen/NwMaZE?editors=1010

I found a Vuetify github bug: https://github./vuetifyjs/vuetify/issues/2377

Vuetify v-select Codepen example: https://codepen.io/zmrqodfu/pen/abZeVOP?editors=101

Vue.use(Vuetify);

var vm = new Vue({
  el: "#app",
  methods: {
  },
  data () {
    return {
      select: { state: 'Florida', abbr: 'FL' },
      hideDetails: false,
      items: [
        { state: 'Florida', abbr: 'FL' },
        { state: 'Georgia', abbr: 'GA' },
        { state: 'Nebraska', abbr: 'NE' },
        { state: 'California', abbr: 'CA' },
        { state: 'New York', abbr: 'NY' }
      ]
    }
  },
});
<script src="https://cdnjs.cloudflare./ajax/libs/vue/2.4.3/vue.js"></script>
<script src="https://unpkg./[email protected]/dist/vuetify.min.js"></script>

<link rel=stylesheet type="text/css" href="https://unpkg./[email protected]/dist/vuetify.min.css">

<div id="app">
    <v-app dark>
       <v-select
            v-bind:items="items"
            v-model="select"
            label="Select"
            single-line
            :hide-details="hideDetails"
            hint="Hint of Select"
            item-text="state"
            item-value="abbr"
            return-object
            autoplete
          ></v-select>
    </v-app>
</div>

Share Improve this question edited Nov 24, 2020 at 6:10 Dan 63.2k18 gold badges111 silver badges119 bronze badges asked Nov 23, 2020 at 15:57 newernewer 1594 silver badges11 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

You can use the menu-props prop:

:menu-props="{ bottom: true, offsetY: true }"

Or, here's how you could position the menu manually:

CSS

.v-menu__content {
   margin-top: 65px;
}

Your updated Codepen

发布评论

评论列表(0)

  1. 暂无评论