Browse Source

no message

linwenxin 8 months ago
parent
commit
2b311e7d9f
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/global-text-processor.js

+ 8 - 0
src/global-text-processor.js

@@ -96,14 +96,22 @@ export const GlobalTextProcessor = {
           this.processTextNodes(this.$el)
           this.autoSelect('operation-btns')
           this.autoSelect('list-display-control-view')
+          this.autoHtmlSelect('title')
         })
       },
       methods: {
+        // 通过class修改
         autoSelect(name) {
           document.querySelectorAll(`.${name}`).forEach(element => {
             this.processAbsolutely(element)
           })
         },
+        // 通过标签名修改
+        autoHtmlSelect(name) {
+          document.getElementsByTagName(name).forEach(element => {
+            this.processAbsolutely(element)
+          })
+        },
         processTextNodes(el) {
           // 遍历子节点并处理文本内容
           if (el.nodeType === Node.ELEMENT_NODE) {