update
This commit is contained in:
@ -9,14 +9,15 @@ interface Props {
|
||||
mainId: string
|
||||
}
|
||||
const { mainId } = Astro.props
|
||||
const count = `detailCount(${mainId})`
|
||||
const q = JSON.stringify(mainId) // 转成带引号的字符串字面量,否则 detailCount(i0008CZYI) 会被 Alpine 当成未定义变量
|
||||
const count = `detailCount(${q})`
|
||||
---
|
||||
|
||||
<button
|
||||
type="button"
|
||||
x-show={`${count} > 0`}
|
||||
x-cloak
|
||||
@click.stop={`openDetailLb(${mainId})`}
|
||||
@click.stop={`openDetailLb(${q})`}
|
||||
:title={`${count} + ' detail' + (${count} > 1 ? 's' : '')`}
|
||||
:aria-label={`${count} + ' detail' + (${count} > 1 ? 's' : '')`}
|
||||
class="absolute left-2 bottom-2 z-10 flex items-center gap-1 px-1.5 py-1 bg-white/85 backdrop-blur-sm border border-black/15 text-[#111] text-[10px] uppercase tracking-[0.14em] cursor-pointer hover:bg-black hover:text-white transition-colors"
|
||||
|
||||
Reference in New Issue
Block a user