Commit 005041638d02953231f4db60765e349b440b3b2b
1 parent
65ee02e8
fix: 修改详情页面bug,prod2-69/70
Showing
2 changed files
with
12 additions
and
7 deletions
components/ProductDetail.vue
@@ -641,11 +641,16 @@ const clearSpanStyle = (htmlContent) => { | @@ -641,11 +641,16 @@ const clearSpanStyle = (htmlContent) => { | ||
641 | const parser = new DOMParser(); | 641 | const parser = new DOMParser(); |
642 | const doc = parser.parseFromString(htmlContent, "text/html"); | 642 | const doc = parser.parseFromString(htmlContent, "text/html"); |
643 | 643 | ||
644 | - // // 清理 span 的 style 属性 | ||
645 | - // const spans = doc.querySelectorAll("span"); | ||
646 | - // spans.forEach((span) => { | ||
647 | - // span?.removeAttribute("style"); // 清空 style 属性 | ||
648 | - // }); | 644 | + // 清理 span 的 style 属性 |
645 | + const spans = doc.querySelectorAll("span"); | ||
646 | + spans.forEach((span) => { | ||
647 | + // 检查span是否在a标签内部 | ||
648 | + const parentAnchor = span.closest('a'); | ||
649 | + if (!parentAnchor) { | ||
650 | + span?.removeAttribute("style"); // 只清空不在a标签内的span的style属性 | ||
651 | + } | ||
652 | + }); | ||
653 | + | ||
649 | 654 | ||
650 | // const imgs = doc.querySelectorAll("img"); | 655 | // const imgs = doc.querySelectorAll("img"); |
651 | // imgs.forEach((img) => { | 656 | // imgs.forEach((img) => { |
deploy/prod2.sh
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | # 变量定义 | 2 | # 变量定义 |
3 | -LAST_TAG="1.0.68" | ||
4 | -TAG="1.0.69" | 3 | +LAST_TAG="1.0.69" |
4 | +TAG="1.0.70" | ||
5 | TARGET_PATH="/root/web/canrud-outside-nuxt-front" | 5 | TARGET_PATH="/root/web/canrud-outside-nuxt-front" |
6 | DOCKERFILE_PATH="/root/web/canrud-outside-nuxt-front/canrud-nuxt-front" | 6 | DOCKERFILE_PATH="/root/web/canrud-outside-nuxt-front/canrud-nuxt-front" |
7 | IMAGE_NAME="canrud-outside-front" | 7 | IMAGE_NAME="canrud-outside-front" |