x-highlight
v1.0.5
Published
A Vue.js plugin use for Syntax highlighting.
Downloads
13
Readme
X-Highlight-Vue
A Vue.js plugin use for Syntax highlighting.
Example
# git clone https://github.com/OXOYO/X-Highlight-Vue.git
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
Usage
Packages install
npm install x-highlight --save
main.js
import XHighlight from 'x-highlight'
import 'x-highlight/dist/css/XHighlight.css'
// highlight theme
import 'highlight.js/styles/zenburn.css'
Vue.use(XHighlight)
demo.vue
<XHighlight
class="x-highlight"
:title="options.title"
:lang="options.lang"
:show="options.show"
:tool="options.tool"
:maxHeight="options.maxHeight"
:locale="options.locale"
:data="options.data"
>
</XHighlight>
Options
| Prop | Type | Default | Describe | |---|---|---|---| | title | String | '' | | | lang | String | 'JavaScript' | | | show | Array | ['title', 'lang', 'num', 'nodata'] | | | tool | Array | ['full-screen', 'select-all', 'copy'] | | | maxHeight | Number | | | | locale | String | 'zh' | | | nodata | String | 暂无数据... | | | data | | '' | |