text: "use strict";(globalThis["webpackChunkquasar_dev"]=globalThis["webpackChunkquasar_dev"]||[]).push([[39730],{39730:(n,a,s)=>{s.r(a),s.d(a,{default:()=>M});var t=s(83673);const o=(0,t._)("p",null,"Quasar 对话是为用户提供选择特定行动或行动列表的能力的一个好方法。它们也可以为用户提供重要的信息，或者要求他们做出一个决定(或多个决定)。",-1),c=(0,t._)("p",null,"从UI的角度来看，你可以把Dialogs看作是一种浮动模式，它只覆盖屏幕的一部分。这意味着Dialogs应该只用于用户的快速操作。",-1),e={class:"doc-note doc-note--tip"},p=(0,t._)("p",{class:"doc-note__title"},"TIP",-1),k=(0,t.Uk)("对话框也可以在你的Vue文件模板中作为一个组件使用(用于复杂的使用情况，如特定的表单组件，可选择的选项等)。为此，请访问"),l=(0,t.Uk)("QDialog"),u=(0,t.Uk)(" 页面。"),i=(0,t._)("p",null,"相对于QDialog组件，将Dialogs作为Quasar Plugins使用的好处是，该插件也可以从Vue空间之外调用，不需要你管理它们的模板。但结果是，它们的定制不能与对应的组件相比。",-1),_=(0,t._)("p",null,[(0,t.Uk)("然而，"),(0,t._)("strong",null,"你也可以为对话框插件提供一个组件来渲染"),(0,t.Uk)('(见 "调用自定义组件 "一节)，这是一个避免用内联对话框弄乱你的Vue模板的好方法(而且它还可以帮助你更好地组织你的项目文件，还可以重复使用对话框)。')],-1),r=(0,t._)("p",null,"通过QDialog插件，你可以通过编程建立三种类型的对话框，其表单内容如下。",-1),U=(0,t._)("ol",null,[(0,t._)("li",null,"一个提示对话框–要求用户在一个输入字段中填写某种数据。"),(0,t._)("li",null,"一组选项，供用户使用单选按钮或切换按钮(仅单选)或复选框(用于多选)进行选择。"),(0,t._)("li",null,"一个简单的确认对话框，用户可以取消或给她一个特定的动作或输入的 “OK”。")],-1),d=(0,t._)("p",null,[(0,t.Uk)("为了创建 #1，提示输入表单，你在"),(0,t._)("code",{class:"doc-token"},"opts"),(0,t.Uk)("对象中有"),(0,t._)("code",{class:"doc-token"},"prompt"),(0,t.Uk)("属性。")],-1),g=(0,t._)("p",null,[(0,t.Uk)("为了创建 #2，选项选择表单, 你在"),(0,t._)("code",{class:"doc-token"},"opts"),(0,t.Uk)("对象中有"),(0,t._)("code",{class:"doc-token"},"options"),(0,t.Uk)("属性.")],-1),m=(0,t._)("pre",{class:"doc-code language-js"},[(0,t._)("code",{class:"doc-code__inner doc-code__inner--prerendered language-js"},[(0,t._)("span",{class:"token comment"},"// 在Vue文件之外"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token keyword"},"import"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)(" Dialog "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)(),(0,t._)("span",{class:"token keyword"},"from"),(0,t.Uk)(),(0,t._)("span",{class:"token string"},"'quasar'"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token punctuation"},"("),(0,t.Uk)("Object"),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(" Dialog"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"create"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)(),(0,t._)("span",{class:"token operator"},"..."),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n\n"),(0,t._)("span",{class:"token comment"},"// 在一个Vue文件中"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token keyword"},"import"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)(" useQuasar "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)(),(0,t._)("span",{class:"token keyword"},"from"),(0,t.Uk)(),(0,t._)("span",{class:"token string"},"'quasar'"),(0,t.Uk)("\n\n"),(0,t._)("span",{class:"token function"},"setup"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token keyword"},"const"),(0,t.Uk)(" $q "),(0,t._)("span",{class:"token operator"},"="),(0,t.Uk)(),(0,t._)("span",{class:"token function"},"useQuasar"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n  $q"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"dialog"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)(),(0,t._)("span",{class:"token operator"},"..."),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token comment"},"// returns Object"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n")])],-1),y=(0,t._)("p",null,"请检查API卡，看看返回的对象是什么。",-1),h=(0,t._)("div",{class:"doc-note doc-note--tip"},[(0,t._)("p",{class:"doc-note__title"},"TIP"),(0,t._)("p",null,"对于下面所有的示例，在你检查的时候也可以看到浏览器的控制台。")],-1),f=(0,t._)("div",{class:"doc-note doc-note--warning"},[(0,t._)("p",{class:"doc-note__title"},"WARNING"),(0,t._)("p",null,"这并不是一个详尽的清单，你可以用对话框作为 Quasar 插件做什么。要进一步探索，请查看API部分。")],-1),q=(0,t._)("p",null,[(0,t.Uk)("您可以使用一个基本的验证系统，以便用户在填写预期值之前无法提交对话框（单击/点击“确定”或按"),(0,t._)("kbd",null,"ENTER"),(0,t.Uk)("）。")],-1),D=(0,t._)("p",null,[(0,t.Uk)("如果您指定 "),(0,t._)("code",{class:"doc-token"},"html: true"),(0,t.Uk)(" 属性，则可以在标题和消息上使用 HTML。 "),(0,t._)("strong",null,"请注意，这可能会导致 XSS 攻击"),(0,t.Uk)("，因此请确保已对消息进行了清理。")],-1),C=(0,t._)("p",null,"您还可以调用自己的自定义组件，而不是依赖 Dialog 插件自带的默认组件。但在这种情况下，您将负责处理所有事情（包括您自己的组件道具）。",-1),v=(0,t._)("p",null,"这个功能实际上是对话框插件的 “面包和黄油”。它通过分离和重复使用对话框的功能，帮助你保持其他vue组件html模板的整洁。",-1),w=(0,t._)("pre",{class:"doc-code language-js"},[(0,t._)("code",{class:"doc-code__inner doc-code__inner--prerendered language-js"},[(0,t._)("span",{class:"token keyword"},"import"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)(" useQuasar "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)(),(0,t._)("span",{class:"token keyword"},"from"),(0,t.Uk)(),(0,t._)("span",{class:"token string"},"'quasar'"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token keyword"},"import"),(0,t.Uk)(" CustomComponent "),(0,t._)("span",{class:"token keyword"},"from"),(0,t.Uk)(),(0,t._)("span",{class:"token string"},"'..path.to.component..'"),(0,t.Uk)("\n\n"),(0,t._)("span",{class:"token function"},"setup"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token keyword"},"const"),(0,t.Uk)(" $q "),(0,t._)("span",{class:"token operator"},"="),(0,t.Uk)(),(0,t._)("span",{class:"token function"},"useQuasar"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n\n  $q"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"dialog"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token literal-property property"},"component"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(" CustomComponent"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n    "),(0,t._)("span",{class:"token comment"},"// 转发到你的自定义组件的属性"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token literal-property property"},"componentProps"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token literal-property property"},"text"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token string"},"'something'"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"// ...更多...属性..."),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},")"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"onOk"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token operator"},"=>"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n    console"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"log"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token string"},"'OK'"),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},")"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"onCancel"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token operator"},"=>"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n    console"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"log"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token string"},"'Cancel'"),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},")"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"onDismiss"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token operator"},"=>"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n    console"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"log"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token string"},"'Called on OK or Cancel'"),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n")])],-1),b=(0,t._)("p",null,[(0,t.Uk)("上述与Options API等效的方法是直接使用"),(0,t._)("code",{class:"doc-token"},"this.$q.dialog({ ... })"),(0,t.Uk)("。")],-1),O=(0,t._)("div",{class:"doc-note doc-note--warning"},[(0,t._)("p",{class:"doc-note__title"},"WARNING"),(0,t._)("p",null,[(0,t.Uk)("然而，你的自定义组件必须遵循下面描述的接口，以便完美地与对话框插件挂钩。"),(0,t._)("strong",null,'注意"必须"的注释'),(0,t.Uk)("，并按原样接受它–只是一个赤裸裸的示例，仅此而已。")])],-1),P=(0,t.Uk)("我们将使用 "),Q=(0,t.Uk)("useDialogPluginComponent"),H=(0,t.Uk)(" 组合。"),x=(0,t._)("pre",{class:"doc-code language-html"},[(0,t._)("code",{class:"doc-code__inner doc-code__inner--prerendered language-html"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("template")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token comment"},"\x3c!-- 注意这儿的 dialogRef  --\x3e"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("q-dialog")]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"ref"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("dialogRef"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"@hide"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("onDialogHide"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("q-card")]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"class"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("q-dialog-plugin"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"\x3c!--\n        ...内容\n        ... 使用 q-card-section 吗?\n      --\x3e"),(0,t.Uk)("\n\n      "),(0,t._)("span",{class:"token comment"},"\x3c!-- 按钮示例 --\x3e"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("q-card-actions")]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"align"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("right"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("q-btn")]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"color"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("primary"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"label"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("OK"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"@click"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("onOKClick"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"/>")]),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("q-btn")]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"color"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("primary"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"label"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("Cancel"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"@click"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("onCancelClick"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"/>")]),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"</"),(0,t.Uk)("q-card-actions")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"</"),(0,t.Uk)("q-card")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"</"),(0,t.Uk)("q-dialog")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n"),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"</"),(0,t.Uk)("template")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n\n"),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("script")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t._)("span",{class:"token script"},[(0,t._)("span",{class:"token language-javascript"},[(0,t.Uk)("\n"),(0,t._)("span",{class:"token keyword"},"import"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)(" useDialogPluginComponent "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)(),(0,t._)("span",{class:"token keyword"},"from"),(0,t.Uk)(),(0,t._)("span",{class:"token string"},"'quasar'"),(0,t.Uk)("\n\n"),(0,t._)("span",{class:"token keyword"},"export"),(0,t.Uk)(),(0,t._)("span",{class:"token keyword"},"default"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token literal-property property"},"props"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},"// ...你的定制属性"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n  "),(0,t._)("span",{class:"token literal-property property"},"emits"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"["),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},"// 必须的；需要指定一些事件，你的"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},"// 组件将通过useDialogPluginComponent()发出。"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token operator"},"..."),(0,t.Uk)("useDialogPluginComponent"),(0,t._)("span",{class:"token punctuation"},"."),(0,t.Uk)("emits\n  "),(0,t._)("span",{class:"token punctuation"},"]"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n  "),(0,t._)("span",{class:"token function"},"setup"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},"// 必需的；必须在setup()中调用。"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token keyword"},"const"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)(" dialogRef"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)(" onDialogHide"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)(" onDialogOK"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)(" onDialogCancel "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)(),(0,t._)("span",{class:"token operator"},"="),(0,t.Uk)(),(0,t._)("span",{class:"token function"},"useDialogPluginComponent"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},"// dialogRef - 应用于QDialog的Vue ref值"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},"// onDialogHide - 用于处理QDialog上的@hide的函数。"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},'// onDialogOK - 调用函数，以解决对话框的 "OK "结果。'),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},"//                    示例：onDialogOK() - 没有有效载荷"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},"//                    例如：onDialogOK({ /*.../* })--带有效载荷"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},'// onDialogCancel - 用 "取消 "的结果来结算对话框的函数。'),(0,t.Uk)("\n\n    "),(0,t._)("span",{class:"token keyword"},"return"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"// 这是必须的。"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"// 需要注入这些(从useDialogPluginComponent()调用)。"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"// 进入vue范围，用于vue html模板"),(0,t.Uk)("\n      dialogRef"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n      onDialogHide"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n      "),(0,t._)("span",{class:"token comment"},"// 我们在vue html模板中使用的其他方法。"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"// 这些是我们示例的一部分(所以不是必须的)。"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token function"},"onOKClick"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token comment"},"// 在确定的情况下，它必须是"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token comment"},"// 调用onDialogOK(带可选的有效载荷)。"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token function"},"onDialogOK"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token comment"},"// 或带有有效载荷：onDialogOK({ ... })"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token comment"},"// ...它也会自动隐藏该对话框"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n      "),(0,t._)("span",{class:"token comment"},"// 我们可以直接通过onDialogCancel。"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token literal-property property"},"onCancelClick"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(" onDialogCancel\n    "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n")])]),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"</"),(0,t.Uk)("script")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n")])],-1),j=(0,t._)("p",null,[(0,t.Uk)("如果你想以对象形式定义"),(0,t._)("code",{class:"doc-token"},"emits"),(0,t.Uk)("，那么(需要Quasar v2.2.5+)：")],-1),K=(0,t._)("pre",{class:"doc-code language-js"},[(0,t._)("code",{class:"doc-code__inner doc-code__inner--prerendered language-js"},[(0,t._)("span",{class:"token literal-property property"},"emits"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token comment"},"// 必须的；需要指定一些事件，你的"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token comment"},"// 组件将通过useDialogPluginComponent()发出。"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token operator"},"..."),(0,t.Uk)("useDialogPluginComponent"),(0,t._)("span",{class:"token punctuation"},"."),(0,t.Uk)("emitsObject"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n  "),(0,t._)("span",{class:"token comment"},"// ......你自己的定义"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token punctuation"},"]"),(0,t.Uk)("\n")])],-1),W=(0,t._)("pre",{class:"doc-code language-html"},[(0,t._)("code",{class:"doc-code__inner doc-code__inner--prerendered language-html"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("template")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("q-dialog")]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"ref"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("dialog"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"@hide"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("onDialogHide"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("q-card")]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"class"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("q-dialog-plugin"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"\x3c!--\n        ...内容\n        ... 使用 q-card-section 吗?\n      --\x3e"),(0,t.Uk)("\n\n      "),(0,t._)("span",{class:"token comment"},"\x3c!-- 按钮示例 --\x3e"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("q-card-actions")]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"align"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("right"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("q-btn")]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"color"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("primary"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"label"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("OK"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"@click"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("onOKClick"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"/>")]),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("q-btn")]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"color"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("primary"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"label"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("Cancel"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token attr-name"},"@click"),(0,t._)("span",{class:"token attr-value"},[(0,t._)("span",{class:"token punctuation attr-equals"},"="),(0,t._)("span",{class:"token punctuation"},'"'),(0,t.Uk)("onCancelClick"),(0,t._)("span",{class:"token punctuation"},'"')]),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"/>")]),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"</"),(0,t.Uk)("q-card-actions")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"</"),(0,t.Uk)("q-card")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"</"),(0,t.Uk)("q-dialog")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n"),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"</"),(0,t.Uk)("template")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n\n"),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"<"),(0,t.Uk)("script")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t._)("span",{class:"token script"},[(0,t._)("span",{class:"token language-javascript"},[(0,t.Uk)("\n"),(0,t._)("span",{class:"token keyword"},"export"),(0,t.Uk)(),(0,t._)("span",{class:"token keyword"},"default"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token literal-property property"},"props"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},"// ...你的定制属性"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n  "),(0,t._)("span",{class:"token literal-property property"},"emits"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"["),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},"// 必需的"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token string"},"'ok'"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)(),(0,t._)("span",{class:"token string"},"'hide'"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token punctuation"},"]"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n  "),(0,t._)("span",{class:"token literal-property property"},"methods"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},"// 以下方法是必须的"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},'// (不要改变它的名字--\x3e"展示")'),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token function"},"show"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token keyword"},"this"),(0,t._)("span",{class:"token punctuation"},"."),(0,t.Uk)("$refs"),(0,t._)("span",{class:"token punctuation"},"."),(0,t.Uk)("dialog"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"show"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n    "),(0,t._)("span",{class:"token comment"},"// 以下方法是必须的"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token comment"},'// (不要改变它的名字--\x3e"隐藏")'),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token function"},"hide"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token keyword"},"this"),(0,t._)("span",{class:"token punctuation"},"."),(0,t.Uk)("$refs"),(0,t._)("span",{class:"token punctuation"},"."),(0,t.Uk)("dialog"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"hide"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n    "),(0,t._)("span",{class:"token function"},"onDialogHide"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"// 需要排放的气体"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},'// 当QDialog发出 "隐藏 "事件时'),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token keyword"},"this"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"$emit"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token string"},"'hide'"),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n    "),(0,t._)("span",{class:"token function"},"onOKClick"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"// 在确定的情况下，它必须是"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},'// 发出 "ok "事件(有可选的有效载荷)。'),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"// 在隐藏QDialog之前"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token keyword"},"this"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"$emit"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token string"},"'ok'"),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"// 或带有有效载荷： this.$emit('ok', { ... })"),(0,t.Uk)("\n\n      "),(0,t._)("span",{class:"token comment"},"// 然后隐藏对话"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token keyword"},"this"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"hide"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n    "),(0,t._)("span",{class:"token function"},"onCancelClick"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token comment"},"// 我们只需要隐藏对话框"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token keyword"},"this"),(0,t._)("span",{class:"token punctuation"},"."),(0,t._)("span",{class:"token function"},"hide"),(0,t._)("span",{class:"token punctuation"},"("),(0,t._)("span",{class:"token punctuation"},")"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n")])]),(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token tag"},[(0,t._)("span",{class:"token punctuation"},"</"),(0,t.Uk)("script")]),(0,t._)("span",{class:"token punctuation"},">")]),(0,t.Uk)("\n")])],-1),I=(0,t._)("p",null,"Quasar 默认为你处理后退按钮，所以它可以隐藏任何打开的对话框，而不是默认的行为，即返回到前一页(这不是一个好的用户体验)。",-1),T=(0,t._)("p",null,"然而，如果你想禁用这种行为，请编辑你的/quasar.conf.js文件：",-1),V=(0,t._)("pre",{class:"doc-code language-js"},[(0,t._)("code",{class:"doc-code__inner doc-code__inner--prerendered language-js"},[(0,t._)("span",{class:"token comment"},"// quasar.conf.js;"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token comment"},"// 仅适用于 Cordova"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token keyword"},"return"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token literal-property property"},"framework"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token literal-property property"},"config"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token literal-property property"},"cordova"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token comment"},"// Quasar 在手机后退按钮上处理应用程序退出。"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token literal-property property"},"backButtonExit"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token boolean"},"true"),(0,t._)("span",{class:"token operator"},"/"),(0,t._)("span",{class:"token boolean"},"false"),(0,t._)("span",{class:"token operator"},"/"),(0,t._)("span",{class:"token string"},"'*'"),(0,t._)("span",{class:"token operator"},"/"),(0,t._)("span",{class:"token punctuation"},"["),(0,t._)("span",{class:"token string"},"'/login'"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)(),(0,t._)("span",{class:"token string"},"'/home'"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)(),(0,t._)("span",{class:"token string"},"'/my-page'"),(0,t._)("span",{class:"token punctuation"},"]"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n        "),(0,t._)("span",{class:"token comment"},"// 另一方面，以下是完全地"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token comment"},"// 禁用 Quasar 的后退按钮管理。"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token literal-property property"},"backButton"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token boolean"},"true"),(0,t._)("span",{class:"token operator"},"/"),(0,t._)("span",{class:"token boolean"},"false"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n\n"),(0,t._)("span",{class:"token comment"},"// quasar.conf.js;"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token comment"},"// 仅适用用于 Capacitor"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token keyword"},"return"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token literal-property property"},"framework"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token literal-property property"},"config"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token literal-property property"},"capacitor"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token punctuation"},"{"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token comment"},"// Quasar 在手机后退按钮上处理应用程序退出。"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token literal-property property"},"backButtonExit"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token boolean"},"true"),(0,t._)("span",{class:"token operator"},"/"),(0,t._)("span",{class:"token boolean"},"false"),(0,t._)("span",{class:"token operator"},"/"),(0,t._)("span",{class:"token string"},"'*'"),(0,t._)("span",{class:"token operator"},"/"),(0,t._)("span",{class:"token punctuation"},"["),(0,t._)("span",{class:"token string"},"'/login'"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)(),(0,t._)("span",{class:"token string"},"'/home'"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)(),(0,t._)("span",{class:"token string"},"'/my-page'"),(0,t._)("span",{class:"token punctuation"},"]"),(0,t._)("span",{class:"token punctuation"},","),(0,t.Uk)("\n\n        "),(0,t._)("span",{class:"token comment"},"// 另一方面，以下是完全地"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token comment"},"// 禁用 Quasar 的后退按钮管理。"),(0,t.Uk)("\n        "),(0,t._)("span",{class:"token literal-property property"},"backButton"),(0,t._)("span",{class:"token operator"},":"),(0,t.Uk)(),(0,t._)("span",{class:"token boolean"},"true"),(0,t._)("span",{class:"token operator"},"/"),(0,t._)("span",{class:"token boolean"},"false"),(0,t.Uk)("\n      "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n    "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n  "),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n"),(0,t._)("span",{class:"token punctuation"},"}"),(0,t.Uk)("\n")])],-1);function $(n,a,s,$,A,R){const B=(0,t.up)("doc-link"),E=(0,t.up)("doc-api"),M=(0,t.up)("doc-installation"),N=(0,t.up)("doc-example"),L=(0,t.up)("doc-page");return(0,t.wg)(),(0,t.j4)(L,{"meta-title":$.metaTitle,title:"对话框插件",related:$.related,nav:$.nav,toc:$.toc,"meta-desc":$.metaDesc},{default:(0,t.w5)((()=>[o,c,(0,t._)("div",e,[p,(0,t._)("p",null,[k,(0,t.Wm)(B,{to:"/vue-components/dialog"},{default:(0,t.w5)((()=>[l])),_:1}),u])]),i,_,r,U,d,g,(0,t._)("h2",{id:"dialog-api",class:"doc-heading doc-h2",onClick:a[0]||(a[0]=n=>$.copyHeading("dialog-api"))},"Dialog API"),(0,t.Wm)(E,{file:"Dialog"}),(0,t._)("h2",{id:"安装",class:"doc-heading doc-h2",onClick:a[1]||(a[1]=n=>$.copyHeading("安装"))},"安装"),(0,t.Wm)(M,{plugins:"Dialog"}),(0,t._)("h2",{id:"使用方法",class:"doc-heading doc-h2",onClick:a[2]||(a[2]=n=>$.copyHeading("使用方法"))},"使用方法"),m,y,(0,t._)("h3",{id:"预定义的",class:"doc-heading doc-h3",onClick:a[3]||(a[3]=n=>$.copyHeading("预定义的"))},"预定义的"),h,f,(0,t.Wm)(N,{title:"Basic",file:"Dialog/Basic"}),(0,t.Wm)(N,{title:"Dark mode",file:"Dialog/Dark"}),(0,t.Wm)(N,{title:"Radios, Checkboxes, Toggles",file:"Dialog/Pickers"}),(0,t.Wm)(N,{title:"Other options",file:"Dialog/OtherOptions"}),(0,t._)("h3",{id:"基础验证",class:"doc-heading doc-h3",onClick:a[4]||(a[4]=n=>$.copyHeading("基础验证"))},"基础验证"),q,(0,t.Wm)(N,{title:"Prompt with validation",file:"Dialog/ValidationPrompt"}),(0,t.Wm)(N,{title:"Options with validation",file:"Dialog/ValidationOptions"}),(0,t._)("h3",{id:"进度条",class:"doc-heading doc-h3",onClick:a[5]||(a[5]=n=>$.copyHeading("进度条"))},"进度条"),(0,t.Wm)(N,{title:"Showing progress",file:"Dialog/Progress"}),(0,t._)("h3",{id:"使用-html",class:"doc-heading doc-h3",onClick:a[6]||(a[6]=n=>$.copyHeading("使用-html"))},"使用 HTML"),D,(0,t.Wm)(N,{title:"Unsafe HTML message",file:"Dialog/UnsafeHtml"}),(0,t._)("h3",{id:"调用自定义组件",class:"doc-heading doc-h3",onClick:a[7]||(a[7]=n=>$.copyHeading("调用自定义组件"))},"调用自定义组件"),C,v,w,b,O,(0,t._)("h4",{id:"组合式-api-的变体",class:"doc-heading doc-h4",onClick:a[8]||(a[8]=n=>$.copyHeading("组合式-api-的变体"))},"组合式 API 的变体"),(0,t._)("p",null,[P,(0,t.Wm)(B,{to:"/vue-composables/use-dialog-plugin-component"},{default:(0,t.w5)((()=>[Q])),_:1}),H]),x,j,K,(0,t._)("h4",{id:"选项式-api-变体",class:"doc-heading doc-h4",onClick:a[9]||(a[9]=n=>$.copyHeading("选项式-api-变体"))},"选项式 API 变体"),W,(0,t._)("h2",{id:"cordova-capacitor-后退按钮",class:"doc-heading doc-h2",onClick:a[10]||(a[10]=n=>$.copyHeading("cordova-capacitor-后退按钮"))},"Cordova/Capacitor 后退按钮"),I,T,V])),_:1},8,["meta-title","related","nav","toc","meta-desc"])}var A=s(17536);const R={name:"DocMarkdownPage",setup(){return{metaTitle:"对话框插件",metaDesc:"一个 Quasar 插件，它提供了一种简单的方法，以对话框的形式显示提示、选择、确认或警告。",related:[{name:"对话框",category:"Vue 组件",path:"/vue-components/dialog"},{name:"底部工作表",category:"Quasar 插件",path:"/quasar-plugins/bottom-sheet"},{name:"useDialogPluginComponent",category:"Vue 可组合性",path:"/vue-composables/use-dialog-plugin-component"}],nav:[{name:"黑暗",category:"Quasar 插件",path:"/quasar-plugins/dark",dir:"left"},{name:"加载",category:"Quasar 插件",path:"/quasar-plugins/loading",dir:"right"}],toc:[{id:"dialog-api",title:"Dialog API"},{id:"安装",title:"安装"},{id:"使用方法",title:"使用方法"},{id:"预定义的",title:"预定义的",sub:!0},{id:"基础验证",title:"基础验证",sub:!0},{id:"进度条",title:"进度条",sub:!0},{id:"使用-html",title:"使用 HTML",sub:!0},{id:"调用自定义组件",title:"调用自定义组件",sub:!0},{id:"cordova-capacitor-后退按钮",title:"Cordova/Capacitor 后退按钮"}],copyHeading:A.Et}}};var B=s(74260);const E=(0,B.Z)(R,[["render",$]]),M=E}}]);