@@ -35,7 +35,12 @@ Then use it as follows:
3535 Open dialog
3636 </button >
3737
38- <a11y-dialog id =" app-dialog" app-root =" #app" @dialog-ref =" assignDialogRef" >
38+ <a11y-dialog
39+ id =" app-dialog"
40+ app-root =" #app"
41+ dialog-root =" #dialog-root"
42+ @dialog-ref =" assignDialogRef"
43+ >
3944 <h1 slot =" title" >Your dialog title</h1 >
4045 <div >
4146 <p >Your content</p >
@@ -66,6 +71,19 @@ export default {
6671}
6772```
6873
74+ In your ` index.html ` , add a container where your dialog will be rendered into.
75+
76+ ``` html
77+ <!DOCTYPE html>
78+ <html >
79+ <body >
80+ <div id =" app" ></div >
81+ <!-- built files will be auto injected -->
82+ <div id =" dialog-root" ></div >
83+ </body >
84+ </html >
85+ ```
86+
6987It's important to assign the direct reference to the dialog instance via ` @dialog-ref ` , otherwise there is no way to call its methods.
7088
7189Alternatively, you can also import the component directly into your file without installing it first:
@@ -114,7 +132,7 @@ export default {
114132```
115133
116134### ` app-root `
117- - ** Property** : ` appRoot `
135+ - ** Property** : ` app-root `
118136- ** Type** : ` String ` , ` Array<String> ` — CSS Selector string.
119137- ** Required** : ` true `
120138- ** Description** : The selector(s) ` a11y-dialog ` needs to disable when the dialog is open.
@@ -125,6 +143,18 @@ export default {
125143</a11y-dialog >
126144```
127145
146+ ### ` dialog-root `
147+ - ** Property** : ` dialog-root `
148+ - ** Type** : ` String ` — CSS Selector string.
149+ - ** Required** : ` true `
150+ - ** Description** : The container for the dialog to be rendered into.
151+ - ** Usage** :
152+ ``` html
153+ <a11y-dialog dialog-root =" #dialog-root" >
154+ <!-- ... -->
155+ </a11y-dialog >
156+ ```
157+
128158### ` class-names `
129159- ** Property** : ` class-names `
130160- ** Type** : ` Object `
@@ -139,7 +169,7 @@ export default {
139169```
140170
141171### ` title-id `
142- - ** Property** : ` titleId `
172+ - ** Property** : ` title-id `
143173- ** Type** : ` String `
144174- ** Required** : ` false `
145175- ** Default** : Defaults to ` id + '-title' ` .
@@ -152,7 +182,7 @@ export default {
152182```
153183
154184### ` close-button-label `
155- - ** Property** : ` closeButtonLabel `
185+ - ** Property** : ` close-button-label `
156186- ** Type** : ` String `
157187- ** Required** : ` false `
158188- ** Default** : ` 'Close this dialog window' `
0 commit comments