https://github.com/oxoyo/x-highlight-vue
A Vue.js plugin use for Syntax highlighting.
https://github.com/oxoyo/x-highlight-vue
vue-highlight
Last synced: 10 months ago
JSON representation
A Vue.js plugin use for Syntax highlighting.
- Host: GitHub
- URL: https://github.com/oxoyo/x-highlight-vue
- Owner: OXOYO
- License: mit
- Created: 2018-07-29T15:09:36.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T08:34:20.000Z (over 3 years ago)
- Last Synced: 2025-03-27T02:51:15.226Z (over 1 year ago)
- Topics: vue-highlight
- Language: JavaScript
- Homepage: http://oxoyo.co/X-Highlight-Vue/
- Size: 1.85 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# X-Highlight-Vue
[](https://www.npmjs.com/package/x-highlight)
[](https://www.npmjs.com/package/x-highlight)
[](https://npmjs.org/package/x-highlight)
[](https://www.npmjs.com/package/x-highlight)

> A Vue.js plugin use for Syntax highlighting.
## Example
[Demo](https://oxoyo.github.io/X-Highlight-Vue/)
``` bash
# 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
``` bash
npm install x-highlight --save
```
main.js
```bash
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
```bash
```
## 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](http://opensource.org/licenses/MIT)