Skip to content

Commit

Permalink
docs: 📝 updates another example to import
Browse files Browse the repository at this point in the history
  • Loading branch information
davidroyer committed Jun 12, 2019
1 parent a9f9752 commit 2e7fb3a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 33 deletions.
23 changes: 21 additions & 2 deletions docs/.vuepress/code-examples/source/event-listening.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<vue-editor v-model="content" />
<vue-editor
v-model="content"
@focus="onEditorFocus"
@blur="onEditorBlur"
@selection-change="onSelectionChange"
/>
</template>

<script>
Expand All @@ -10,6 +15,20 @@ export default {
data: () => ({
content: "<h1>Some initial content</h1>"
})
}),
methods: {
onEditorBlur(quill) {
console.log("editor blur!", quill);
},
onEditorFocus(quill) {
console.log("editor focus!", quill);
},
onSelectionChange(range) {
console.log("selection change!", range);
}
}
};
</script>
32 changes: 1 addition & 31 deletions docs/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,34 +244,4 @@ Give the editor instance a `ref` property

## Listening For Events

<!-- <<< @/docs/.vuepress/code-examples/source/event-listening.vue -->

```vue
<template>
<vue-editor
@focus="onEditorFocus"
@blur="onEditorBlur"
@selection-change="onSelectionChange"
v-model="editor2Content"
>
</vue-editor>
</template>
<script type="text/javascript">
export default {
methods: {
onEditorBlur(quill) {
console.log("editor blur!", quill);
},
onEditorFocus(quill) {
console.log("editor focus!", quill);
},
onSelectionChange(range) {
console.log("selection change!", range);
}
}
};
</script>
```
<<< @/docs/.vuepress/code-examples/source/event-listening.vue

0 comments on commit 2e7fb3a

Please sign in to comment.