From 57a1c2bc925859213cc3435f20e73ce4ef19598a Mon Sep 17 00:00:00 2001 From: ajaxzheng <894103554@qq.com> Date: Fri, 6 Dec 2024 09:17:01 +0800 Subject: [PATCH] fix(anchor): [anchor] fixed the bug that querySelect cannot select special id --- packages/renderless/package.json | 2 +- packages/renderless/src/anchor/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/renderless/package.json b/packages/renderless/package.json index 9544c4d57b..3cf5f80131 100644 --- a/packages/renderless/package.json +++ b/packages/renderless/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/vue-renderless", - "version": "3.20.2", + "version": "3.20.3", "private": true, "description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.", "author": "OpenTiny Team", diff --git a/packages/renderless/src/anchor/index.ts b/packages/renderless/src/anchor/index.ts index 887a47dde8..9e5d90ec80 100644 --- a/packages/renderless/src/anchor/index.ts +++ b/packages/renderless/src/anchor/index.ts @@ -13,7 +13,7 @@ import type { IAnchorRenderlessParams, IAnchorLinkItem } from '@/types' import { addClass, removeClass } from '../common/deps/dom' const getEleMentBySelect = (parent, selector) => - selector?.startsWith('#') ? document.getElementById('selector') : parent.querySelector(selector) + selector?.startsWith('#') ? document.getElementById(selector.slice(1)) : parent.querySelector(selector) export const setFixAnchor = ({ vm, props }: Pick) =>