Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
450 views
in Technique[技术] by (71.8m points)

javascript - 在vuetify中使用datepicker创建可扩展的应用栏(creating an expandable app bar with datepicker in vuetify)

I am trying to create an expandable app bar in Vuetify, which shows a datepicker within the app bar when the app bar is expanded.

(我正在尝试在Vuetify中创建一个可扩展的应用程序栏,当该应用程序栏展开时,该栏会在应用程序栏中显示一个日期选择器。)

When the app bar is expanded, the datepicker is shown as an overlay instead of expanding the app bar.

(展开应用程序栏时,日期选择器将显示为覆盖图,而不是展开应用程序栏。)

How do I make the app bar expand to contain the datepicker instead of showing the datepicker on top of the app bar.

(如何使应用程序栏扩展为包含日期选择器,而不是在应用程序栏顶部显示日期选择器。)

I have created a codepen as an example: https://codepen.io/thomasabcd/pen/eYmOoVQ

(我创建了一个Codepen作为示例: https ://codepen.io/thomasabcd/pen/eYmOoVQ)

<div id="app">
  <v-app id="inspire">
    <div>
      <v-app-bar dark>

        <v-toolbar-title>Page title</v-toolbar-title>

        <v-spacer></v-spacer>

        <v-btn icon @click="extended=!extended">
          <v-icon>mdi-calendar</v-icon>
        </v-btn>

        <template v-slot:extension v-if="extended">
          <v-date-picker full-width />
        </template>
      </v-app-bar>
    </div>
  </v-app>
</div>

new Vue({
  el: '#app',
  vuetify: new Vuetify(),
  data(){
    return{
      extended: false
    }
  }
})
  ask by ThomasD translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...