Former-commit-id: 0a96bb54e9270e451e59b72e00e35053a7c0e152 Former-commit-id: c250ba90da6546626b9831847630aae786c88344 Former-commit-id: c1182b1bdc6ea9b3934275286a93e2760a643bfe
41 lines
709 B
Markdown
41 lines
709 B
Markdown
`highLight` 组件已经全局注册,可以直接使用
|
|
|
|
组件内部使用 `Prism` 实现代码高亮
|
|
|
|
```
|
|
<Card>
|
|
<p slot="title">示例1</p>
|
|
<highLight :data="test1"></highLight>
|
|
</Card>
|
|
<br>
|
|
<Card>
|
|
<p slot="title">示例2</p>
|
|
<highLight :data="test2"></highLight>
|
|
</Card>
|
|
<br>
|
|
<Card>
|
|
<p slot="title">示例3</p>
|
|
<highLight :data="test3" :stringify="false"></highLight>
|
|
</Card>
|
|
```
|
|
|
|
数据源
|
|
|
|
```
|
|
data () {
|
|
return {
|
|
test1: [0, 1, 2, 3],
|
|
test2: {
|
|
name: 'me',
|
|
like: [
|
|
'like1',
|
|
'like2'
|
|
],
|
|
address: [
|
|
'address1'
|
|
]
|
|
},
|
|
test3: '<Markdown url="/static/markdownFiles/article/highLight组件使用方法.md"></Markdown>'
|
|
}
|
|
}
|
|
``` |