x-highlight

1.0.5 • Public • Published

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

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 ''

License

MIT

Package Sidebar

Install

npm i x-highlight

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

617 kB

Total Files

5

Last publish

Collaborators

  • oxoyo