@yunlefun/vue 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components/YlfDialog.vue
CHANGED
|
@@ -20,10 +20,13 @@ const props = withDefaults(defineProps<{
|
|
|
20
20
|
description?: string
|
|
21
21
|
/** 没有可见标题时供屏幕阅读器使用 */
|
|
22
22
|
accessibleTitle?: string
|
|
23
|
+
/** Accessible name of the close button; localize it with the dialog content. */
|
|
24
|
+
closeLabel?: string
|
|
23
25
|
/** Existing container in the same theme boundary. */
|
|
24
26
|
portalTo?: string | HTMLElement
|
|
25
27
|
}>(), {
|
|
26
28
|
accessibleTitle: '对话框',
|
|
29
|
+
closeLabel: '关闭',
|
|
27
30
|
})
|
|
28
31
|
|
|
29
32
|
const open = defineModel<boolean>('open', { default: false })
|
|
@@ -63,7 +66,7 @@ const descriptionProps = computed(() => hasDescription.value
|
|
|
63
66
|
<slot />
|
|
64
67
|
</div>
|
|
65
68
|
|
|
66
|
-
<DialogClose class="ylf-dialog__close" aria-label="
|
|
69
|
+
<DialogClose class="ylf-dialog__close" :aria-label="closeLabel">
|
|
67
70
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
68
71
|
<path d="M6 6l12 12M18 6L6 18" />
|
|
69
72
|
</svg>
|
|
@@ -7,13 +7,16 @@ title_zh: 对话框
|
|
|
7
7
|
|
|
8
8
|
## Props
|
|
9
9
|
|
|
10
|
-
| 属性 | 说明
|
|
11
|
-
| ----------------- |
|
|
12
|
-
| `v-model:open` | 显隐状态
|
|
13
|
-
| `title` | 可见标题
|
|
14
|
-
| `description` | 描述
|
|
15
|
-
| `accessibleTitle` | 无可见标题时供辅助技术读取的标题
|
|
16
|
-
| `
|
|
10
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
11
|
+
| ----------------- | ---------------------------------- | ----------------------- | ----------------------- |
|
|
12
|
+
| `v-model:open` | 显隐状态 | `boolean` | `false` |
|
|
13
|
+
| `title` | 可见标题 | `string` | — |
|
|
14
|
+
| `description` | 描述 | `string` | — |
|
|
15
|
+
| `accessibleTitle` | 无可见标题时供辅助技术读取的标题 | `string` | `'对话框'` |
|
|
16
|
+
| `closeLabel` | 关闭按钮的无障碍名称,可随正文翻译 | `string` | `'关闭'` |
|
|
17
|
+
| `portalTo` | 已存在的主题内浮层容器 | `string \| HTMLElement` | ConfigProvider / `body` |
|
|
18
|
+
|
|
19
|
+
英文界面可设置 `close-label="Close"`,让关闭按钮与正文语言一致。
|
|
17
20
|
|
|
18
21
|
建议始终提供 `title`。只有视觉设计明确隐藏标题时,才改用描述场景的 `accessible-title`。
|
|
19
22
|
|
|
@@ -3,6 +3,8 @@ type __VLS_Props = {
|
|
|
3
3
|
description?: string;
|
|
4
4
|
/** 没有可见标题时供屏幕阅读器使用 */
|
|
5
5
|
accessibleTitle?: string;
|
|
6
|
+
/** Accessible name of the close button; localize it with the dialog content. */
|
|
7
|
+
closeLabel?: string;
|
|
6
8
|
/** Existing container in the same theme boundary. */
|
|
7
9
|
portalTo?: string | HTMLElement;
|
|
8
10
|
};
|
|
@@ -26,6 +28,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
26
28
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
27
29
|
}>, {
|
|
28
30
|
accessibleTitle: string;
|
|
31
|
+
closeLabel: string;
|
|
29
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
33
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
31
34
|
declare const _default: typeof __VLS_export;
|