Quasar JS 可折叠在迷你状态下的抽屉折叠中

Quasar JS collapsible in drawer collapse on mini state

我正在使用 Quasar JS 版本 v0.17.19,我希望在 mouseout 时布局抽屉进入迷你状态,但可折叠项目保持可扩展状态,仅显示图标。鼠标移开布局抽屉进入迷你状态;但是,已展开的项目已折叠。我已经查看了文档,但没有看到针对此行为的任何配置。

<q-layout-drawer side="left" no-hide-on-route-change overlay v-model="isLeftDrawerOpen" 
        content-class="bg-blue-grey-10" @mouseover="miniState = false" @mouseout="miniState = true" 
        :mini="miniState" :width=290 :breakpoint="1037">
        <user-menu />
    </q-layout-drawer>

布局抽屉中没有默认选项,但您可以通过编程方式实现。请参考下面的例子。

<q-layout-drawer
      v-model="isLeftDrawerOpen"
      :mini="miniState"
      @mouseover="miniState = false"
      @mouseout="miniState = true;"
    >
      <q-list>
        <q-item>
          <component :is="comp" v-model="comp_model" icon="settings" label="Settings">
            <div>
              <q-list
                no-border
                inset-delimiter
              >
                <q-item v-if="miniState && comp=='div'">
                  <q-item-side icon="settings">
                  </q-item-side>
                  <q-item-main>
                    Settings
                  </q-item-main>
                </q-item>
                <q-item>
                  <q-item-side icon="insert_drive_file">
                  </q-item-side>
                  <q-item-main>
                    User Accounts
                  </q-item-main>

                </q-item>
                <q-item>
                  <q-item-side icon="group">
                  </q-item-side>
                  <q-item-main>
                    User Accounts
                  </q-item-main>
                </q-item>
              </q-list>
            </div>
          </component>
        </q-item>
      </q-list>
    </q-layout-drawer>



    data() {
      return {
        comp:'q-collapsible',
        isLeftDrawerOpen: true,
        comp_model:false,
        miniState:true,
      }
    },
    watch: {
       'miniState': function () {
         if (this.miniState && this.comp_model) {
           this.comp = 'div'
         }
         else{
           this.comp = 'q-collapsible'
         }
       }
     }