1.0.5 • Published 5 years ago

x-highlight v1.0.5

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

X-Highlight-Vue

Version License NPM downloads Downloads JS gzip size

A Vue.js plugin use for Syntax highlighting.

Example

Demo

# 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

PropTypeDefaultDescribe
titleString''
langString'JavaScript'
showArray'title', 'lang', 'num', 'nodata'
toolArray'full-screen', 'select-all', 'copy'
maxHeightNumber
localeString'zh'
nodataString暂无数据...
data''

License

MIT