|
@@ -21,7 +21,7 @@
|
|
>
|
|
>
|
|
<div class="text-wrapper">
|
|
<div class="text-wrapper">
|
|
<p>
|
|
<p>
|
|
- {{ elemType + (elemType ? ': ' : '') + elemDisc }}
|
|
|
|
|
|
+ {{ elemType + ((elemType && elemDisc) ? ': ' : '') + elemDisc }}
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<button
|
|
<button
|
|
@@ -667,6 +667,18 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ this.$eventBus.$on('request-process-image-element', (rootElement) => {
|
|
|
|
+ console.log('无障碍组件收到request-process-image-element消息:', rootElement);
|
|
|
|
+ const tagNameList = [
|
|
|
|
+ 'img',
|
|
|
|
+ ]
|
|
|
|
+ for (const tagName of tagNameList) {
|
|
|
|
+ const elemList = rootElement.getElementsByTagName(tagName)
|
|
|
|
+ for (const elemItem of elemList) {
|
|
|
|
+ elemItem.setAttribute('tabindex', '0')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
|
|
const config = { attributes: true, childList: true, subtree: true };
|
|
const config = { attributes: true, childList: true, subtree: true };
|
|
const callback = (mutationsList, observer) => {
|
|
const callback = (mutationsList, observer) => {
|
|
@@ -703,7 +715,8 @@ export default {
|
|
this.$eventBus.$off('request-read')
|
|
this.$eventBus.$off('request-read')
|
|
this.$eventBus.$off('request-magnify')
|
|
this.$eventBus.$off('request-magnify')
|
|
this.$eventBus.$off('request-process-text-element')
|
|
this.$eventBus.$off('request-process-text-element')
|
|
-
|
|
|
|
|
|
+ this.$eventBus.$off('request-process-image-element')
|
|
|
|
+
|
|
this.mutationObserver.disconnect();
|
|
this.mutationObserver.disconnect();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|