Skip to content

OXOYO/X-Highlight-Vue

Repository files navigation

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

About

A Vue.js plugin use for Syntax highlighting.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published