|
@@ -7,7 +7,7 @@
|
|
|
const isZh = localStorage.getItem('lang') === 'zh_CN';
|
|
const isZh = localStorage.getItem('lang') === 'zh_CN';
|
|
|
|
|
|
|
|
let loading = true;
|
|
let loading = true;
|
|
|
- const getMdStrFunc = async nav => {
|
|
|
|
|
|
|
+ const getMdStrFunc = async (nav) => {
|
|
|
loading = true;
|
|
loading = true;
|
|
|
// const rawObj = await import(`../../../../doc/components/${nav}/api${isZh ? '' : '_en'}.md`);
|
|
// const rawObj = await import(`../../../../doc/components/${nav}/api${isZh ? '' : '_en'}.md`);
|
|
|
const rawObj = await import(`../../../../mds/components/${nav}/api${isZh ? '' : '_en'}.md`);
|
|
const rawObj = await import(`../../../../mds/components/${nav}/api${isZh ? '' : '_en'}.md`);
|
|
@@ -15,14 +15,14 @@
|
|
|
loading = false;
|
|
loading = false;
|
|
|
return mdTextToHljs(mdStr.replace(/<a href="/g, '<a target="_blank" href="'));
|
|
return mdTextToHljs(mdStr.replace(/<a href="/g, '<a target="_blank" href="'));
|
|
|
};
|
|
};
|
|
|
- $: apiText = getMdStrFunc(api).then(res => {
|
|
|
|
|
|
|
+ $: apiText = getMdStrFunc(api).then((res) => {
|
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
|
apiText = res;
|
|
apiText = res;
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<article
|
|
<article
|
|
|
- class="prose dark:prose-invert max-w-none pb-12 prose-table:break-all overflow-x-auto prose-td:whitespace-nowrap md:prose-td:whitespace-normal"
|
|
|
|
|
|
|
+ class="prose dark:prose-invert prose-table:break-all prose-td:whitespace-nowrap md:prose-td:whitespace-normal max-w-none overflow-x-auto pb-12"
|
|
|
>
|
|
>
|
|
|
{#if loading}
|
|
{#if loading}
|
|
|
{isZh ? '请等待...' : 'Please wait...'}
|
|
{isZh ? '请等待...' : 'Please wait...'}
|
|
@@ -30,14 +30,15 @@
|
|
|
{@html apiText}
|
|
{@html apiText}
|
|
|
{/if}
|
|
{/if}
|
|
|
</article>
|
|
</article>
|
|
|
-<div class="pb-8 text-xs flex gap-2">
|
|
|
|
|
|
|
+<div class="flex gap-2 pb-8 text-xs">
|
|
|
|
|
+ <!-- main -> next -->
|
|
|
<a
|
|
<a
|
|
|
- href={'https://github.com/any-tdf/stdf/edit/main/doc/components/' + api + '/api' + (isZh ? '' : '_en') + '.md'}
|
|
|
|
|
|
|
+ href={'https://github.com/any-tdf/stdf/edit/next/docs/mds/components/' + api + '/api' + (isZh ? '' : '_en') + '.md'}
|
|
|
target="_blank"
|
|
target="_blank"
|
|
|
- class="flex text-primary dark:text-dark"
|
|
|
|
|
|
|
+ class="text-primary dark:text-dark flex"
|
|
|
>
|
|
>
|
|
|
- <span class="h-4 w-4 mr-1">
|
|
|
|
|
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="w-4 h-4" style="fill: currentColor;">
|
|
|
|
|
|
|
+ <span class="mr-1 h-4 w-4">
|
|
|
|
|
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-4 w-4" style="fill: currentColor;">
|
|
|
<path
|
|
<path
|
|
|
d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
|
|
d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
|
|
|
/>
|
|
/>
|