【docs】:Code example 'setup' is missing (#7153)

* flx

* flx【docs】:Modify the official website code example, switch TS to JS, the top of the example should be '<script setup>'
This commit is contained in:
yang 2023-12-18 10:22:04 +08:00 committed by GitHub
parent 562623c091
commit 07c36192b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,7 @@ ${vueCode?.trim()}
const scriptContent = fetchCode(vueCode, 'scriptContent'); const scriptContent = fetchCode(vueCode, 'scriptContent');
let jsCode = (await tsToJs(scriptContent))?.trim(); let jsCode = (await tsToJs(scriptContent))?.trim();
jsCode = jsCode jsCode = jsCode
? `<script> ? `<script setup>
${jsCode} ${jsCode}
</script>` </script>`
: ''; : '';
@ -139,13 +139,13 @@ import ColorChunk from '@/components/ColorChunk';
import TokenTable from '@/components/TokenTable'; import TokenTable from '@/components/TokenTable';
import ComponentTokenTable from '@/components/ComponentTokenTable'; import ComponentTokenTable from '@/components/ComponentTokenTable';
export default { export default {
components: { components: {
ColorChunk, ColorChunk,
TokenTable, TokenTable,
ComponentTokenTable ComponentTokenTable
}, },
pageData: ${JSON.stringify(pageData)} pageData: ${JSON.stringify(pageData)}
} }
</script> </script>
${fetchCode(content, 'style')} ${fetchCode(content, 'style')}