fix(floating): 修复悬浮二维码按钮在前端不生成二维码

二维码容器原输出 .float-btn-qrcode + data-qrcode-url/data-qr-text,
无任何 JS 读取;改用运行时 main.min.js 已有的 .qrcode + data-qrcode
契约渲染 canvas,并修正 CSS 中无效的 :deep() 选择器避免整条规则被丢弃。
This commit is contained in:
kate522 committed 2026-08-22 17:58:53 +08:00
1 parent b169574b25
commit 25bb0213d4
2 files changed
+8 -8

No files matched your search

+2 -2
View File
@@ -265,8 +265,8 @@
transform: translateX(-2px); transform: translateX(-2px);
} }
.float-btn-qrcode :deep(canvas), .float-btn-qrcode canvas,
.float-btn-qrcode :deep(img), .float-btn-qrcode img,
.float-btn-qrcode svg { .float-btn-qrcode svg {
display: block; display: block;
margin: 0 auto; margin: 0 auto;
+6 -6
View File
@@ -334,12 +334,12 @@ if ($floating_enabled) :
?> ?>
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" aria-label="<?php echo esc_attr($item_text ?: __('二维码', 'aksrt')); ?>"<?php echo $style_attr; ?>> <a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" aria-label="<?php echo esc_attr($item_text ?: __('二维码', 'aksrt')); ?>"<?php echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i> <i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<div class="hover-show-con"> <div class="hover-show-con">
<div <div
class="float-btn-qrcode" class="qrcode float-btn-qrcode"
data-qrcode-url="<?php echo esc_attr(get_permalink() ?: home_url('/')); ?>" data-qrcode="<?php echo esc_attr(get_permalink() ?: home_url('/')); ?>"
data-qr-text="<?php echo esc_attr(get_permalink() ?: home_url('/')); ?>" data-size="120"
></div> ></div>
<?php if ($item_text !== '') : ?><p class="float-btn-qrcode__title"><?php echo esc_html($item_text); ?></p><?php endif; ?> <?php if ($item_text !== '') : ?><p class="float-btn-qrcode__title"><?php echo esc_html($item_text); ?></p><?php endif; ?>
</div> </div>
</a> </a>