mirror of
https://github.com/tenrok/vue-tribute.git
synced 2026-06-18 20:00:36 +03:00
Initial commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<textarea @keyup="syncToEditor">{{ editorDisplayVal }}</textarea>
|
||||
<prosemirror :content="editorVal" :on-change="editorChanged" menu-type="tooltip"></prosemirror>
|
||||
</template>
|
||||
<script>
|
||||
import VueProseMirror from "../";
|
||||
export default {
|
||||
name: "app",
|
||||
data(){
|
||||
return {
|
||||
editorVal: "",
|
||||
editorDisplayVal: ""
|
||||
}
|
||||
},
|
||||
ready(){
|
||||
console.log("Ready!")
|
||||
},
|
||||
methods: {
|
||||
editorChanged(raw, rendered){
|
||||
this.editorDisplayVal = raw;
|
||||
console.log(rendered)
|
||||
},
|
||||
syncToEditor($event){
|
||||
this.editorVal = $event.target.value;
|
||||
}
|
||||
},
|
||||
components: {
|
||||
prosemirror: VueProseMirror
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.vueProseMirror .ProseMirror .ProseMirror-content{
|
||||
width: 500px;
|
||||
margin: 50px auto;
|
||||
border: 1px solid #eee;
|
||||
outline: none;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,6 @@
|
||||
import Vue from "vue";
|
||||
import app from "./app";
|
||||
new Vue({
|
||||
el: "body",
|
||||
components: { app }
|
||||
})
|
||||
Reference in New Issue
Block a user