refactor: move utils
This commit is contained in:
@@ -2,7 +2,7 @@ import { customElement, noShadowDOM } from "solid-element";
|
||||
import { createSignal, onCleanup } from "solid-js";
|
||||
import { render } from "solid-js/web";
|
||||
import { Article } from "./Article";
|
||||
import { resolvePath } from "../utils/path";
|
||||
import { resolvePath } from "./utils/path";
|
||||
|
||||
customElement("md-link", {}, (props, { element }) => {
|
||||
noShadowDOM();
|
||||
@@ -11,7 +11,7 @@ customElement("md-link", {}, (props, { element }) => {
|
||||
const [expanded, setExpanded] = createSignal(false);
|
||||
let articleContainer: HTMLDivElement | undefined;
|
||||
let disposeArticle: (() => void) | null = null;
|
||||
let articleElement: HTMLElement | undefined;
|
||||
let articleElement: HTMLElement | null | undefined;
|
||||
|
||||
// 从 element 的 textContent 获取链接目标(支持 path#section 语法)
|
||||
const rawLinkSrc = element?.textContent?.trim() || "";
|
||||
|
||||
Reference in New Issue
Block a user