Skip to content
This repository was archived by the owner on Dec 9, 2022. It is now read-only.

Commit bc817a1

Browse files
Merge pull request ChangJoo-Park#73 from the-hashtag-project/master
Improved README.md
2 parents ca1b5d1 + 278f42e commit bc817a1

File tree

1 file changed

+61
-14
lines changed

1 file changed

+61
-14
lines changed

README.md

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55

66
vue-editor-js is editorjs wrapper component.
77

8-
Please see this first. https://editorjs.io/
8+
Please review this first. https://editorjs.io/
99

1010
## For before 2.0.0 version users.
1111

12-
This plugins is turned to be just wrapper component.
13-
If you need to use plugin for editor.js, just import and set to config property.
12+
This plugins is a wrapper component for editorjs.
13+
If you need to use the plugin for editor.js then import it and set the config property.
1414

1515
Please See the [Demo.vue](https://github.com/ChangJoo-Park/vue-editor-js/blob/master/demo/Demo.vue)
1616

1717

1818
## For before 1.0.0 version users.
1919

20-
Please `Vue.use` vue-editor-js in main.js.
20+
Please use `Vue.use` vue-editor-js in main.js.
2121

2222
## Supported Plugins
2323

@@ -41,6 +41,7 @@ Please `Vue.use` vue-editor-js in main.js.
4141
## Installation
4242

4343
```bash
44+
# NPM
4445
npm install --save vue-editor-js
4546

4647
# or Yarn
@@ -49,18 +50,17 @@ yarn add vue-editor-js
4950

5051
## Usage
5152

53+
### In main.js
5254
```js
53-
// In main.js
5455
// ...
5556
import Editor from 'vue-editor-js'
5657

5758
Vue.use(Editor)
5859
// ...
5960
```
6061

62+
### In Nuxt.js
6163
```js
62-
// on Nuxt.js
63-
6464
// in nuxt.config.js
6565
plugins: [
6666
{
@@ -79,19 +79,20 @@ Vue.use(Editor)
7979
<editor ref="editor" :config="config" :initialized="onInitialized"/>
8080
```
8181

82-
define initialize Function for get instance of editor.js when initialized
82+
Define the initialization function to get the instance of editor.js when initializing
8383

84-
If you confused using on Nuxt, please see [here](https://github.com/ChangJoo-Park/vue-editor-on-nuxt)
84+
If you are confused with using it with Nuxt, please see [here](https://github.com/ChangJoo-Park/vue-editor-on-nuxt)
8585

8686
## Local import
8787

88-
You can import Editor only in components where you need it.
88+
If you wish to only import Editor on a single component then you can do so by following the instructions below
8989

9090
1. Make sure to install `@vue/composition-api`
9191
```bash
92+
# NPM
9293
npm i --save @vue/composition-api
9394

94-
#or Yarn
95+
# or Yarn
9596
yarn add @vue/composition-api
9697
```
9798
2. In main.js:
@@ -137,14 +138,60 @@ Same as in Supported Plugins, but with different naming
137138

138139

139140
### Usage
141+
142+
1. Install the editorjs tool
143+
144+
```bash
145+
# NPM
146+
npm install --save @editorjs/header
147+
148+
# or Yarn
149+
yarn add @editorjs/header
150+
```
151+
152+
2. Insert the package into the config prop
153+
154+
```vue
155+
<editor
156+
...
157+
:config="{
158+
tools: {
159+
header: require('@editorjs/header')
160+
}
161+
}"
162+
/>
163+
```
164+
165+
#### Saving Example Code
140166
```vue
141-
<editor header list code ... :config="config"/>
167+
<template>
168+
<div id="app">
169+
<Editor ref="editor" :config="config" />
170+
171+
<button @click="invokeSave">Save</button>
172+
</div>
173+
</template>
174+
175+
<script>
176+
export default {
177+
methods: {
178+
invokeSave() {
179+
this.$refs.editor._data.state.editor.save()
180+
.then((data) => {
181+
// Do what you want with the data here
182+
console.log(data)
183+
})
184+
.catch(err => { console.log(err) })
185+
}
186+
},
187+
}
188+
</script>
142189
```
143190

144191
## Upload Image (>= 1.1.0)
145192

146-
for upload image, You need a backend for processing image. vue-editor-js provide special `config` props for easy.
147-
If you server for test upload image, please see [server example](https://github.com/ChangJoo-Park/vue-editor-js-imageserver).
193+
for uploading images, You will need a backend for processing the images. vue-editor-js provides a special `config` prop for easability.
194+
If you are testing your server to upload an image, please see [server example](https://github.com/ChangJoo-Park/vue-editor-js-imageserver).
148195

149196
```vue
150197
<editor :config="config" />

0 commit comments

Comments
 (0)