Skip to content

Commit

Permalink
fix(highlighter-provder): fix CodeToHtmlOptions types
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Oct 14, 2024
1 parent ede0626 commit dd0d2d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/code/Code.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineComponent({
if (highlighter) {
watch(
() => [highlighter.value, props.code, props.language, normalizedTheme.value, props.trim] as const,
async ([highlighter, code, lang, theme, trim]) => {
async ([highlighter, code, lang = '', theme = '', trim]) => {
if (!highlighter) {
return
}
Expand Down
4 changes: 2 additions & 2 deletions packages/varlet-ui/src/highlighter-provider/props.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PropType } from 'vue'

export interface CodeToHtmlOptions {
lang?: string
theme?: string
lang: string
theme: string
}

export interface Highlighter {
Expand Down
4 changes: 2 additions & 2 deletions packages/varlet-ui/types/highlighterProvider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { VarComponent, BasicAttributes, SetPropsDefaults } from './varComponent'
export declare const highlighterProps: Record<keyof HighlighterProviderProps, any>

export interface CodeToHtmlOptions {
lang?: string
theme?: string
lang: string
theme: string
}

export interface Highlighter {
Expand Down

0 comments on commit dd0d2d7

Please sign in to comment.