-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wuchao
committed
Dec 17, 2024
1 parent
54773b9
commit 357a25b
Showing
11 changed files
with
149 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -397,6 +397,10 @@ html.dark { | |
.breadcrumb { | ||
color: #fff; | ||
} | ||
.others-box { | ||
color: #fff; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<!-- eslint-disable vue/no-v-html --> | ||
<template> | ||
<div class="code-container"> | ||
<pre> | ||
<code class="language-javascript" v-html="highlightedCode" /> | ||
</pre> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { ref, onMounted, watch } from 'vue'; | ||
import hljs from 'highlight.js/lib/core'; | ||
import javascript from 'highlight.js/lib/languages/javascript'; | ||
import 'highlight.js/styles/monokai.css'; | ||
|
||
hljs.registerLanguage('javascript', javascript); | ||
|
||
const highlightedCode = ref(''); | ||
|
||
onMounted(() => { | ||
const highlighted = hljs.highlight(` | ||
import { App, createApp } from 'vue'; | ||
import router from './routes'; | ||
|
||
import Vue3Toasity, { type ToastContainerOptions } from 'vue3-toastify'; | ||
|
||
import Root from './App.vue'; | ||
|
||
import Antd from 'ant-design-vue'; | ||
import 'ant-design-vue/dist/reset.css'; | ||
|
||
function resolveGLobalComponents(instance: App<Element>) { | ||
instance.use(Antd); | ||
} | ||
|
||
const app = createApp(Root); | ||
|
||
app.use(router); | ||
|
||
resolveGLobalComponents(app); | ||
|
||
app.use( | ||
Vue3Toasity, | ||
{ | ||
// the Toast application is separate from the main application, so we need to call .use | ||
useHandler: resolveGLobalComponents, | ||
// other props... | ||
} as ToastContainerOptions, | ||
); | ||
|
||
app.mount('#app'); | ||
`, { language: 'javascript' }).value; | ||
|
||
highlightedCode.value = highlighted; | ||
}); | ||
</script> | ||
|
||
<style> | ||
.code-container { | ||
font-family: Hack, monospace; | ||
border-radius: 5px; | ||
box-shadow: 0 20px 68px rgba(0, 0, 0, 0.55); | ||
position: relative; | ||
padding: 0 12px; | ||
overflow-x: auto; | ||
transition: background-color .5s; | ||
color: #CFD2D1 !important; | ||
background-color: #151718 !important; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-variant-ligatures: contextual; | ||
font-weight: 400; | ||
letter-spacing: normal; | ||
line-height: 18.6167px | ||
} | ||
|
||
pre{ | ||
margin: 0; | ||
} | ||
|
||
.hljs-keyword { | ||
color: #c586c0; | ||
} | ||
|
||
.hljs-string { | ||
color: #ce9178; | ||
} | ||
|
||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import { ToastContainerOptions } from '..'; | ||
import { reactive } from 'vue'; | ||
|
||
export const appInstance = reactive<{ useHandler: any }>({ useHandler: undefined }); | ||
|
||
export const globalOptions = reactive<{ [key: string]: ToastContainerOptions }>({}); | ||
|
||
export const globalCache = reactive({} as { lastUrl: string }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters