Skip to content

Commit bfaa870

Browse files
author
F-loat
committed
translate documents into English
1 parent 993b78e commit bfaa870

File tree

3 files changed

+37
-40
lines changed

3 files changed

+37
-40
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 F-loat
3+
Copyright (c) 2018 F-loat
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
[![npm package](https://img.shields.io/npm/v/vue-simplemde.svg)](https://npmjs.org/package/vue-simplemde)
55
[![npm downloads](http://img.shields.io/npm/dm/vue-simplemde.svg)](https://npmjs.org/package/vue-simplemde)
66

7-
# Demo
8-
[Demo Page](https://F-loat.github.io/vue-simplemde/)
7+
## Examples
8+
9+
> No longer support Vue1.x, you can modify to use
10+
11+
* [Demo Page](https://f-loat.github.io/vue-simplemde/)
12+
* [Demo Source](https://github.com/F-loat/vue-simplemde/tree/gh-pages)
13+
* [Simple Example](./examples/index.vue)
14+
* [Nuxt Example](./examples/nuxt)
915

1016
# Use Setup
1117

@@ -22,15 +28,15 @@ npm install vue-simplemde --save
2228
## Use
2329

2430
``` javascript
25-
// 全局引用
31+
// Global reference
2632
import Vue from 'vue'
2733
import VueSimplemde from 'vue-simplemde'
2834

2935
Vue.use(VueSimplemde)
3036
```
3137

3238
``` javascript
33-
// 单个组件内引用
39+
// Internal reference in a single component
3440
import markdownEditor from 'vue-simplemde/src/markdown-editor'
3541

3642
export default {
@@ -41,26 +47,17 @@ export default {
4147
```
4248

4349
## Props
44-
| 属性 | 类型 | 默认值 | 描述 |
50+
| property | type | default | describe |
4551
| ----| ----- | ----- | ---- |
46-
| value | String || 初始值,可使用v-model绑定 |
47-
| preview-class | String || 自定义预览样式类 |
48-
| autoinit | Boolean | true | 是否自动初始化 |
49-
| highlight | Boolean | false | 是否开启高亮 |
50-
| sanitize | Boolean | false | 开启后不渲染输入的html |
51-
| configs | Object | {} | [SimpleMDE的配置项](#configuration) |
52-
53-
## Examples
54-
55-
> 不再支持Vue1.x,可自行修改使用
56-
57-
* [Demo Page](https://f-loat.github.io/vue-simplemde/)
58-
* [Demo Source](https://github.com/F-loat/vue-simplemde/tree/gh-pages)
59-
* [Simple Example](./examples/index.vue)
60-
* [Nuxt Example](./examples/nuxt)
52+
| value | String | None | Initial value, v-model binding can be used |
53+
| preview-class | String | None | Custom preview style class |
54+
| autoinit | Boolean | true | Automatic initialization |
55+
| highlight | Boolean | false | Is it open to highlight |
56+
| sanitize | Boolean | false | HTML that does not render input after opening |
57+
| configs | Object | {} | [SimpleMDE's config](#configuration) |
6158

6259
## Markdown style
63-
> e.g. 使用Github的markdown样式
60+
> e.g. use Github's markdown style
6461
6562
[github-markdown-css](https://github.com/sindresorhus/github-markdown-css)
6663

@@ -103,12 +100,12 @@ $ npm install --save highlight.js
103100
<style>
104101
@import '~simplemde/dist/simplemde.min.css';
105102
@import '~highlight.js/styles/atom-one-dark.css';
106-
/* 高亮主题可选列表:https://github.com/isagalaev/highlight.js/tree/master/src/styles */
103+
/* Highlight theme list: https://github.com/isagalaev/highlight.js/tree/master/src/styles */
107104
</style>
108105
```
109106

110107
## Editor Theme ([simplemde-theme-base](https://github.com/xcatliu/simplemde-theme-base/wiki/List-of-themes))
111-
> e.g. 使用simplemde-theme-base主题
108+
> e.g. use simplemde-theme-base theme
112109
113110
### install
114111
```
@@ -119,12 +116,12 @@ $ npm install --save simplemde-theme-base
119116
``` vue
120117
<style>
121118
@import '~simplemde-theme-base/dist/simplemde-theme-base.min.css';
122-
/* 无需引入simplemde.min.css */
119+
/* no need import imposimplemde.min.css */
123120
</style>
124121
```
125122

126123
## Configuration
127-
> SimpleMDE的配置
124+
> SimpleMD's config
128125
129126
* [中文](doc/configuration_zh.md)
130127
* [English](doc/configuration_en.md)
@@ -137,4 +134,4 @@ $ npm install --save simplemde-theme-base
137134

138135
vue-simplemde is open source and released under the MIT Licence.
139136

140-
Copyright (c) 2017 F-loat
137+
Copyright (c) 2018 F-loat

examples/index.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<template>
22
<div>
3-
<!-- 通过 v-model 控制 value -->
3+
<!-- use v-model control value -->
44
<markdown-editor v-model="content" ref="markdownEditor"></markdown-editor>
55

6-
<!-- 通过事件控制 value -->
6+
<!-- use event control value -->
77
<markdown-editor :value="content" @input="handleInput"></markdown-editor>
88

9-
<!-- 添加配置 -->
9+
<!-- add config -->
1010
<markdown-editor :configs="configs"></markdown-editor>
1111

12-
<!-- 不自动初始化 -->
12+
<!-- disable auto init -->
1313
<markdown-editor :autoinit="false"></markdown-editor>
1414
</div>
1515
</template>
1616

1717
<script>
1818
import markdownEditor from 'vue-simplemde/src/markdown-editor'
1919
20-
// 基础用法
20+
// Base example
2121
export default {
2222
components: {
2323
markdownEditor
@@ -26,13 +26,13 @@
2626
return {
2727
content: '',
2828
configs: {
29-
spellChecker: false // 禁用拼写检查
29+
spellChecker: false // disable spell check
3030
}
3131
}
3232
}
3333
}
3434
35-
// 完整示例
35+
// Complete example
3636
export default {
3737
components: {
3838
markdownEditor
@@ -41,8 +41,8 @@
4141
return {
4242
content: '',
4343
configs: {
44-
status: false, // 禁用底部状态栏
45-
spellChecker: false // 禁用拼写检查
44+
status: false, // disable the status bar at the bottom
45+
spellChecker: false // disable spell check
4646
}
4747
}
4848
},
@@ -55,16 +55,16 @@
5555
console.log(this.simplemde)
5656
this.simplemde.togglePreview()
5757
58-
// 'change'事件已经绑定,可以通过@input指定处理器
59-
// 如果需要,你可以自行绑定这个列表中的其他事件: https://codemirror.net/doc/manual.html#events
58+
// 'change' envent has bound, via @input attache an event listener
59+
// You can attache events in this [list](https://codemirror.net/doc/manual.html#events) yourself if necessary
6060
this.simplemde.codemirror.on('beforeChange', (instance, changeObj) => {
6161
// do some things
6262
})
6363
64-
// 移除SimpleMDE,组件销毁时会自动调用
64+
// remove SimpleMDE, when component destroy will invoke
6565
this.simplemde = null
6666
67-
// 一些有用的方法
67+
// some useful methods
6868
this.$refs.markdownEditor.initialize() // init
6969
this.simplemde.toTextArea()
7070
this.simplemde.isPreviewActive() // returns boolean

0 commit comments

Comments
 (0)