<template>
<div>
<medium-editor
v-model="content"
:options="options"
:onChange="onChange"
@uploaded="uploadCallback"
:hideGist ="true"
/>
</div>
</template>
<script>
import Editor from 'vuejs-medium-editor'
export default {
name: 'ArticleWrite',
data() {
return {
content: '',
options: {
toolbar: {
buttons: [
'bold',
'italic',
'underline',
'quote',
'h1',
'h2',
'h3',
//'pre',
'unorderedlist',
'orderedlist',
'justifyLeft',
'justifyCenter',
'justifyRight',
'anchor',
{
name: "image",
action: "image",
aria: "insert image from url",
tagNames: ["img"],
contentDefault: "<b>image</b>",
contentFA: '<i class="fa fa-picture-o"></i>'
}
]
},
}
}
},
components: {
'medium-editor': Editor,
},
methods: {
onChange() {
console.log(this.content)
},
uploadCallback(url) {
console.log('uploaded url', url)
},
},
}
</script>
<style scoped></style>