Skip to content

Commit 490ad10

Browse files
authored
fix(anchor): [anchor] fixed the bug that querySelect cannot select special id (#2620)
1 parent 678ab67 commit 490ad10

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/renderless/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opentiny/vue-renderless",
3-
"version": "3.20.2",
3+
"version": "3.20.3",
44
"private": true,
55
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
66
"author": "OpenTiny Team",

packages/renderless/src/anchor/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { IAnchorRenderlessParams, IAnchorLinkItem } from '@/types'
1313
import { addClass, removeClass } from '../common/deps/dom'
1414

1515
const getEleMentBySelect = (parent, selector) =>
16-
selector?.startsWith('#') ? document.getElementById('selector') : parent.querySelector(selector)
16+
selector?.startsWith('#') ? document.getElementById(selector.slice(1)) : parent.querySelector(selector)
1717

1818
export const setFixAnchor =
1919
({ vm, props }: Pick<IAnchorRenderlessParams, 'vm' | 'props'>) =>

0 commit comments

Comments
 (0)