Skip to content

Commit

Permalink
update use.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ygj6 committed Nov 2, 2021
1 parent ad3b432 commit 72d7f43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
22 changes: 8 additions & 14 deletions doc/cn/use.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,17 @@
```javascript
// 全局注册
// import with ES6
import Vue from 'vue'
import { createApp } from 'vue'
import App from './app.vue';
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
// use
Vue.use(mavonEditor)
new Vue({
'el': '#main',
data() {
return { value: '' }
}
})
createApp(App).use(mavonEditor).mount('#app')
```
`index.html`
```html
// 下同
<div id="main">
<div id="app">
<mavon-editor v-model="value"/>
</div>
```
Expand Down Expand Up @@ -67,12 +62,11 @@
`index.js`:
```javascript
// 下同
import Vue from 'vue';
import { createApp, h } from 'vue'
var editor = require('./editor.vue');
new Vue({
el: '#main',
render: h => h(editor)
});
createApp({
render: () => h(editor)
}).use(sMd).mount('#main');
```
`index.html`:
```html
Expand Down
7 changes: 4 additions & 3 deletions src/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
* @Copyright: 2017
*/

import * as Vue from 'vue';
import { createApp, h } from 'vue';
import editor from './app.vue';
var sMd = require('../index.js');

var app = Vue.createApp(editor).use(sMd).mount('#main');
window.app = app
createApp({
render: () => h(editor)
}).use(sMd).mount('#main');

0 comments on commit 72d7f43

Please sign in to comment.