Skip to content

Commit f022eaa

Browse files
author
savoygu
committed
Update README.md
1 parent 040b9ac commit f022eaa

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,53 @@
11
# vue-demonstration
22

3-
> Vue-based element docs's demo code style component, asily add examples to your vue project to show your code.
3+
> Vue-based element docs's demo code style component, easily add examples to your Vue project to show your code.
4+
5+
## Install
6+
7+
```bash
8+
npm install vue-demonstration -S
9+
```
10+
11+
## Quick Start
12+
13+
```bash
14+
import Vue from 'vue'
15+
import VueDemo from 'vue-demonstration'
16+
17+
Vue.component('vue-demonstration', VueDemo)
18+
```
19+
20+
For more information, please refer to [vue-demonstration](http://savoygu.github.io/vue-demonstration) in our documentation.
21+
22+
## Usage
23+
24+
```
25+
<template>
26+
<vue-demonstration
27+
title="标题"
28+
description="标题描述"
29+
anchor="锚点"
30+
tag="标题标签" <!-- h2 / h3-->
31+
:highlight="sourcecode">
32+
<template slot="source">
33+
<div>your code</div> <!-- 源代码-->
34+
</template>
35+
<template slot="explanation">
36+
代码描述
37+
</template>
38+
</vue-demonstration>
39+
</template>
40+
<script>
41+
const sourcecode = `<div>your code</div>`
42+
export default {
43+
data () {
44+
sourcecode
45+
}
46+
}
47+
</script>
48+
```
49+
50+
If you want to add some javascript code to `sourcecode`,you need to put the `sourcecode` into a js file.
451

552
## Build Setup
653

@@ -19,4 +66,10 @@ npm run demo:prepublish
1966

2067
# build for production with minification
2168
npm run build
69+
70+
# generate gh-pages
71+
npm run deploy
2272
```
73+
## LICENSE
74+
75+
[MIT](http://opensource.org/licenses/MIT)

0 commit comments

Comments
 (0)