|
2 | 2 |
|
3 | 3 | Import the npm package and only one prop to show highlightCode |
4 | 4 |
|
| 5 | +[](https://vuejs.org) |
| 6 | + |
| 7 | +<p> |
| 8 | + <a href="https://npm-stat.com/charts.html?package=vue-highlight-code"> |
| 9 | + <img alt="Downloads" src="https://img.shields.io/npm/dm/vue-highlight-code.svg"> |
| 10 | + </a> |
| 11 | + <a href="https://npmjs.com/package/vue-highlight-code"> |
| 12 | + <img alt="Version" src="https://img.shields.io/npm/v/vue-highlight-code.svg"/> |
| 13 | + </a> |
| 14 | + <a href="http://packagequality.com/#?package=vue-highlight-code"> |
| 15 | + <img alt="Quality" src="https://npm.packagequality.com/shield/vue-highlight-code.svg"> |
| 16 | + </a> |
| 17 | +</p> |
5 | 18 | ``` |
6 | 19 | yarn add highlight.js vue-highlight-code |
7 | 20 | ``` |
@@ -35,83 +48,20 @@ export default { |
35 | 48 |
|
36 | 49 |
|
37 | 50 |
|
38 | | -### 2. Props |
| 51 | +### Component Props |
39 | 52 |
|
40 | | -#### codeValue `String` |
41 | | - |
42 | | -Description: Highlight Code |
43 | | - |
44 | | - |
45 | | - |
46 | | -#### lang `String` |
47 | | - |
48 | | -default: 'javascript' (such as 'vue','html','css') |
49 | | - |
50 | | -Description: Highlight Code Type |
51 | | - |
52 | | - |
53 | | - |
54 | | -#### theme `String` |
55 | | - |
56 | | -default: 'dark' (only ['dark','light']) |
57 | | - |
58 | | -Description: Highlight Code theme |
59 | | - |
60 | | -#### codeLines `Boolean` |
61 | | - |
62 | | -default: false |
63 | | - |
64 | | -Description: Support Code lines |
65 | | - |
66 | | -#### langName `String` |
67 | | - |
68 | | -Description: Highlight Code Name (Upper left corner display) |
69 | | - |
70 | | - |
71 | | - |
72 | | -#### width `String` |
73 | | - |
74 | | -default: '620px' |
75 | | - |
76 | | -Description: the component width |
77 | | - |
78 | | - |
79 | | - |
80 | | -#### height `String` |
81 | | - |
82 | | -Description: the component height |
83 | | - |
84 | | - |
85 | | - |
86 | | -#### maxWidth `String` |
87 | | - |
88 | | -Description: the component max-width |
89 | | - |
90 | | - |
91 | | - |
92 | | -#### maxHeight `String` |
93 | | - |
94 | | -Description: the component max-height |
95 | | - |
96 | | - |
97 | | - |
98 | | -#### fontSize `Number` |
99 | | - |
100 | | -Description: the highlight code font-size |
101 | | - |
102 | | - |
103 | | - |
104 | | -#### scrollStyleBool `Boolean` |
105 | | - |
106 | | -default: true |
107 | | - |
108 | | -Description: scroll bar style |
109 | | - |
110 | | - |
111 | | - |
112 | | -#### copy `Boolean` |
113 | | - |
114 | | -default: true |
115 | | - |
116 | | -Description: whether the code can copy |
| 53 | +| prop | description | type | default | |
| 54 | +| :-------------- | :---------------------------------------------- | :-------- | :--------------------------------------- | |
| 55 | +| codeValue | Highlight Code Source | `String` | `''` | |
| 56 | +| lang | Highlight Code Type | `String` | `javascript` (such as 'vue','html','css) | |
| 57 | +| theme | Component Highlight Code theme | `String` | default: `dark`(only ['dark','light']) | |
| 58 | +| codeLines | Show Code lines | `Boolean` | `false` | |
| 59 | +| langName | Highlight Code Name (Upper left corner display) | `String` | `` | |
| 60 | +| width | component style width | `String` | `620px` | |
| 61 | +| height | component style height | `String` | `` | |
| 62 | +| maxWidth | component style max-width | `String` | `` | |
| 63 | +| maxHight | component style max-height`String` | `String` | `` | |
| 64 | +| fontSize | highlight code font-size | `Number` | - | |
| 65 | +| scrollStyleBool | component scroll bar style | `Boolean` | `true` | |
| 66 | +| copy | whether the code can copy | `Boolean` | `true` | |
117 | 67 |
|
0 commit comments