提交 f6cfb3f9 编写于 作者: View Design's avatar View Design

123

上级 ac574ab4
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<script setup> <script setup>
const toast = useToast() const toast = useToast()
const slots = useSlots()
const props = defineProps({ const props = defineProps({
code: { code: {
type: String, type: String,
...@@ -53,6 +54,14 @@ const handleCopy = () => { ...@@ -53,6 +54,14 @@ const handleCopy = () => {
title: '复制成功' title: '复制成功'
}) })
} }
watch(
() => slots.default(),
(newValue, oldValue) => {
// 在这里处理默认插槽内容的变化
console.log('Default slot content changed:', newValue)
},
{ immediate: true, deep: true }
)
</script> </script>
<style> <style>
......
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
import { bundledLanguages, type BuiltinLanguage } from 'shiki'
const langs = Object.keys(bundledLanguages).filter(item => item !== 'lisp');
const sw = process.env.SW === 'true' const sw = process.env.SW === 'true'
export default defineNuxtConfig({ export default defineNuxtConfig({
devtools: { devtools: {
...@@ -77,12 +75,5 @@ export default defineNuxtConfig({ ...@@ -77,12 +75,5 @@ export default defineNuxtConfig({
navigateFallbackAllowlist: [/^\/$/], navigateFallbackAllowlist: [/^\/$/],
type: 'module', type: 'module',
}, },
},
mdc: {
highlight: {
highlighter: 'shiki',
theme: 'slack-dark',
langs: langs as BuiltinLanguage[]
}
} }
}) })
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册