API 浏览器
底部表单插件

底部表单从设备屏幕底部边缘向上滑动,并显示一组选项,可用于确认或取消操作。底部表单有时可以用作菜单的替代方案,但是,它们不应该用于导航。

¥Bottom Sheets slide up from the bottom edge of the device screen, and display a set of options with the ability to confirm or cancel an action. Bottom Sheets can sometimes be used as an alternative to menus, however, they should not be used for navigation.

底部表单始终显示在页面上任何其他组件的上方,必须将其关闭才能与底层内容交互。当它被触发时,页面的其余部分会变暗,以便将更多焦点放在底部工作表选项上。

¥The Bottom Sheet always appears above any other components on the page, and must be dismissed in order to interact with the underlying content. When it is triggered, the rest of the page darkens to give more focus to the Bottom Sheet options.

底部表单可以显示为列表或网格,带有图标或头像。它们既可以作为 Vue 文件模板中的组件使用,也可以作为全局可用的方法使用。

¥Bottom Sheets can be displayed as a list or as a grid, with icons or with avatars. They can be used either as a component in your Vue file templates, or as a globally available method.

Loading BottomSheet API...
Installation

// quasar.config file

return {
  framework: {
    plugins: [
      'BottomSheet'
    ]
  }
}

用法(Usage)

¥Usage

Outside of a Vue file

import { BottomSheet } from 'quasar'
BottomSheet.create({ ... }) // returns Object

// inside of a Vue file
import { useQuasar } from 'quasar'
setup () {
  const $q = useQuasar()
  $q.bottomSheet({ ... }) // returns Object
}

提示

当用户点击手机/平板电脑的返回按钮(仅适用于 Cordova 应用)时,操作表将自动关闭。

¥When user hits the phone/tablet back button (only for Cordova apps), the Action Sheet will get closed automatically.

此外,在桌面浏览器中,按 ESCAPE 键也会关闭操作表。

¥Also, when on a desktop browser, hitting the ESCAPE key also closes the Action Sheet.

List and Grid



Force dark mode



提示

要查看选项的详尽列表,请查看 API 部分。

¥For an exhaustive list of options, please check API section.