|
1 | 1 | <template>
|
2 |
| - <div id="app"> |
3 |
| - <div class="container grid-960"> |
4 |
| - <h1>Vue2Editor 2.0 (In Development)</h1> |
5 |
| - <!-- <vue-editor |
| 2 | +<div id="app"> |
| 3 | + <div class="container grid-960"> |
| 4 | + <h1>Vue2Editor 2.0 (In Development)</h1> |
| 5 | + <!-- <vue-editor |
6 | 6 | v-model="content"
|
7 | 7 | :editor-toolbar="customToolbar">
|
8 | 8 | </vue-editor> -->
|
9 |
| - <!-- <button class="btn btn-primary" @click="saveContent(content)">Save</button> --> |
10 |
| - <button class="btn btn-primary" @click="setEditor">Set Editor</button> |
11 |
| - <div class="containers"> |
12 |
| - <div class="editorWrapper column col-6 col-sm-12"> |
13 |
| - <vue-editor v-model="editorContent"></vue-editor> |
14 |
| - <button class="btn btn-primary" @click="saveContent(editorContent)">Save</button> |
15 |
| - </div> |
16 |
| - <div class="column col-6 col-sm-12 preview" v-if="showPreview" v-html="editorContent"></div> |
| 9 | + <!-- <button class="btn btn-primary" @click="saveContent(content)">Save</button> --> |
| 10 | + <button class="btn btn-primary" @click="setEditor">Set Editor</button> |
| 11 | + <button class="btn btn-primary" @click="toggleDisabled">Toggle Disabled</button> |
| 12 | + <div class="columns"> |
| 13 | + <div class="editorWrapper column col-6 col-sm-12"> |
| 14 | + <vue-editor :disabled="editorIsDisabled" v-model="editorContent"></vue-editor> |
| 15 | + <button class="btn btn-primary" @click="saveContent(editorContent)">Save</button> |
17 | 16 | </div>
|
| 17 | + <div id="preview" class="column col-6 col-sm-12" v-if="showPreview" v-html="editorContent"></div> |
18 | 18 | </div>
|
19 | 19 | </div>
|
| 20 | +</div> |
20 | 21 | </template>
|
21 | 22 |
|
22 | 23 | <script>
|
| 24 | +import { |
| 25 | + VueEditor |
| 26 | +} from '../src/index.js' |
23 | 27 |
|
24 |
| - import {VueEditor} from '../src/index.js' |
| 28 | +export default { |
| 29 | + components: { |
| 30 | + VueEditor, |
| 31 | + }, |
| 32 | + data() { |
| 33 | + return { |
| 34 | + editorContent: '<h1>Starting Content</h1>', |
| 35 | + showPreview: true, |
| 36 | + content: '<h1>Html For Editor</h1>', |
| 37 | + editorIsDisabled: false, |
| 38 | + customToolbar: [ |
| 39 | + ['bold', 'italic', 'underline'], |
| 40 | + [{ |
| 41 | + 'list': 'ordered' |
| 42 | + }, { |
| 43 | + 'list': 'bullet' |
| 44 | + }], |
| 45 | + ['image', 'code-block'] |
| 46 | + ] |
| 47 | + } |
| 48 | + }, |
25 | 49 |
|
26 |
| - export default { |
27 |
| - components: { |
28 |
| - VueEditor, |
29 |
| - }, |
30 |
| - data() { |
31 |
| - return { |
32 |
| - editorContent: '<h1>Starting Content</h1>', |
33 |
| - showPreview: true, |
34 |
| - content: '<h1>Html For Editor</h1>', |
35 |
| - customToolbar: [ |
36 |
| - ['bold', 'italic', 'underline'], |
37 |
| - [{ 'list': 'ordered'}, { 'list': 'bullet' }], |
38 |
| - ['image', 'code-block'] |
39 |
| - ] |
40 |
| - } |
| 50 | + methods: { |
| 51 | + setEditor() { |
| 52 | + this.editorContent = 'Set programatically!' |
41 | 53 | },
|
42 | 54 |
|
43 |
| - methods: { |
44 |
| - setEditor() { |
45 |
| - this.editorContent = 'Set programatically!' |
46 |
| - }, |
| 55 | + saveContent(content) { |
| 56 | + console.log(content); |
| 57 | + // console.log(this.editorContent); |
| 58 | + }, |
47 | 59 |
|
48 |
| - saveContent(content) { |
49 |
| - console.log(content); |
50 |
| - // console.log(this.editorContent); |
51 |
| - } |
| 60 | + toggleDisabled() { |
| 61 | + this.editorIsDisabled = !this.editorIsDisabled |
52 | 62 | }
|
53 | 63 | }
|
| 64 | +} |
54 | 65 | </script>
|
55 | 66 |
|
56 | 67 | <style>
|
|
64 | 75 | position: relative;
|
65 | 76 | z-index: 99999;
|
66 | 77 | }
|
67 |
| - .preview { |
68 |
| - flex-basis: 50%; |
69 |
| - background: #f9f9f9; |
70 |
| - padding: .5em 3em; |
71 |
| - }*/ |
| 78 | +*/ |
| 79 | +
|
| 80 | +#preview { |
| 81 | + background: #f6f6f6; |
| 82 | + border-left: 3px solid gray; |
| 83 | + padding: 2em; |
| 84 | + margin-left: 1em; |
| 85 | +} |
| 86 | +@media (min-width: 601px) { |
| 87 | + #preview { |
| 88 | + width: 47%; |
| 89 | + } |
| 90 | +} |
| 91 | +
|
72 | 92 | </style>
|
0 commit comments