# Dialog

<div data-full-width="false"><figure><img src="/files/bVgmGI8SzvoE1GFkkNvv" alt="Dialog 介紹示意圖"><figcaption></figcaption></figure></div>

Dialog 是網頁與使用者一種強烈的互動，這個元件顯示後，將會吸引使用者所有的注意力，所以一般會用在非常重要的地方，或是想讓使用者完全專心的情境之下。

### 基本使用 <a href="#basic" id="basic"></a>

```html
<bpa-button @click="isBpaDialogVisible = true">
  Open Dialog
</bpa-button>

<bpa-dialog :visible.sync="isBpaDialogVisible">
  Content
</bpa-dialog>
```

### 客製化標頭、尾 <a href="#custom-header-footer" id="custom-header-footer"></a>

```html
<bpa-dialog
  :visible.sync="isBpaDialogVisible"
  header="custom header text"
  footer="custom footer text"
>
  Content
</bpa-dialog>
```

```html
<bpa-dialog
  :visible.sync="isBpaDialogVisible"
>
  <template v-slot:header>
    <mark>custom header Html</mark>
  </template>
  Content
  <template v-slot:footer>
    <mark>custom footer Html</mark>
  </template>
</bpa-dialog>
```

### 點擊外面遮罩時，不關閉對話框 <a href="#click-outside" id="click-outside"></a>

```html
<bpa-dialog :clickoutside="false">
  Cotnent
</bpa-dialog>
```

### 屬性 <a href="#props" id="props"></a>

<table data-full-width="false"><thead><tr><th width="143">Name</th><th>Value</th><th>Type</th><th>Default</th><th data-type="checkbox">Required</th><th>Note</th></tr></thead><tbody><tr><td>id</td><td></td><td>String</td><td>random</td><td>false</td><td></td></tr><tr><td>header</td><td>{ text } or template</td><td>String</td><td></td><td>false</td><td></td></tr><tr><td>footer</td><td>{ text } or template</td><td>String</td><td></td><td>false</td><td></td></tr><tr><td>visible</td><td></td><td>Boolean</td><td>false</td><td>false</td><td></td></tr><tr><td>clickoutside</td><td></td><td>Boolean</td><td>true</td><td>false</td><td></td></tr></tbody></table>

### Demo

{% embed url="<https://codesandbox.io/embed/piman-dialog-z5i4v2?fontsize=14&module=/src/App.vue&theme=dark>" fullWidth="false" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bpio.gitbook.io/piman/vue2/dialog.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
