8000 fix: Change the theme type flexibly (#32) · hoiheart/vue-diff@0c7adaf · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 0c7adaf

Browse files
committed
fix: Change the theme type flexibly (#32)
1 parent daa6920 commit 0c7adaf

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ Insert the diff component with props.
105105

106106
### Props
107107

108-
| name | type | detault | values | description |
109-
| ------------- | ----------------- | ----------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
110-
| mode | `string` | `split` | `split`, `unified` |
111-
| theme | `string` | `dark` | `dark`, `light` | See <a href="#custom-theme">Custom theme</a> |
112-
| language | `string` | `plaintext` | | See <a href="#extend-languages">Extend languages</a> |
113-
| prev | `string` | `''` | | Prev code |
114-
| current | `string` | `''` | | Current Code |
115-
| folding | `boolean` | `false` | | Folding not different |
116-
| inputDelay | `number` | `0` | | Setting up rendering debounce for changes for performance benefit (mode, prev, curr) |
117-
| virtualScroll | `boolean\|object` | `false` | | _Default value when setting true :_<br>`{ height: 500, lineMinHeight: 24, delay: 100 }`<br>See <a href="#virtual-scroll">virtual scroll</a> |
108+
| name | type | detault | values | description |
109+
| ------------- | ----------------- | ----------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
110+
| mode | `string` | `split` | `split`, `unified` |
111+
| theme | `string` | `dark` | `dark`, `light`, `custom${string}` | See <a href="#custom-theme">Custom theme</a> |
112+
| language | `string` | `plaintext` | | See <a href="#extend-languages">Extend languages</a> |
113+
| prev | `string` | `''` | | Prev code |
114+
| current | `string` | `''` | | Current Code |
115+
| folding | `boolean` | `false` | | Folding not different |
116+
| inputDelay | `number` | `0` | | Setting up rendering debounce for changes for performance benefit (mode, prev, curr) |
117+
| virtualScroll | `boolean\|object` | `false` | | _Default value when setting true :_<br>`{ height: 500, lineMinHeight: 24, delay: 100 }`<br>See <a href="#virtual-scroll">virtual scroll</a> |
118118

119119
## Custom theme
120120

@@ -131,6 +131,7 @@ npm install highlight.js
131131
<template>
132132
<Diff
133133
:mode="mode"
134+
<!-- Characters that begin with custom -->
134135
theme="custom"
135136
:language="language"
136137
:prev="prev"

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface PluginOptions {
55
}
66

77
export type Mode = 'split' | 'unified';
8-
export type Theme = 'dark' | 'light' | 'custom';
8+
export type Theme = 'dark' | 'light' | `custom${string}`;
99
export type Role = 'prev' | 'current' | 'unified';
1010

1111
export interface Line {

0 commit comments

Comments
 (0)
0