feat: md-pins allow numbers

This commit is contained in:
2026-03-21 18:16:41 +08:00
parent 6f57970711
commit 617fd17def
3 changed files with 102 additions and 27 deletions
+2 -2
View File
@@ -3,13 +3,13 @@ import {Show, For, createResource, createMemo, createSignal} from "solid-js";
import { resolvePath } from "./utils/path";
import { createPinsStore } from "./stores/pinsStore";
customElement("md-pins", { pins: "", fixed: false }, (props, { element }) => {
customElement("md-pins", { pins: "", fixed: false, labelStart: "A" }, (props, { element }) => {
noShadowDOM();
const [showToast, setShowToast] = createSignal(false);
// 创建 store
const store = createPinsStore(props.pins, props.fixed);
const store = createPinsStore(props.pins, props.fixed, props.labelStart);
// 从 element 的 textContent 获取图片路径
const rawSrc = element?.textContent?.trim() || '';