nhn / toast-ui.vue-editor

This repository is DEPRECATED! GO TO 👉 https://github.com/nhn/tui.editor/tree/master/apps/vue-editor
MIT License
229 stars 47 forks source link

How to POST content? #12

Closed pers0n4 closed 5 years ago

pers0n4 commented 5 years ago

Version

... ├── @toast-ui/vue-editor@1.0.4 ├── tui-editor@1.3.1

Current Behavior

<template>
    <form method="POST" action="">
        <slot></slot>
        <editor
            :options="editorOptions"
            height="auto"
            previewStyle="vertical"
            mode="wysiwyg"
            name="edit"
        ></editor>
    </form>
</template>

<script>
import "tui-editor/dist/tui-editor.css";
import "tui-editor/dist/tui-editor-contents.css";
import "tui-editor/dist/tui-editor-extTable.js";
import "tui-editor/dist/tui-editor-extColorSyntax.js"; 
import "tui-editor/dist/tui-editor-extScrollSync.js";
import "tui-color-picker/dist/tui-color-picker.css";
import "codemirror/lib/codemirror.css";
import { Editor } from "@toast-ui/vue-editor";

export default {
    components: {
        "editor": Editor
    },
    data: () => ({
        editorOptions: {
            minHeight: "400px",
            language: "ko_KR",
            exts: [
                "table", "colorSyntax", "scrollSync"
            ]
        },
    })
};
</script>

Expected Behavior

I want to post content from a form but editor has only div elements. How can I do this?

<template>
    <form method="POST" action>
        <slot></slot>
        <input v-model="content" type="text" name="content" hidden>
        <editor
            v-model="content"
            :options="editorOptions"
            height="auto"
            previewStyle="vertical"
            mode="wysiwyg"
            name="edit"
        ></editor>
    </form>
</template>

Is this the best way?