|
@@ -26,9 +26,9 @@
|
|
|
</div>
|
|
|
<div class="exersices-content">
|
|
|
<IconText :text="'题目'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
|
|
|
- <div class="my-editor-deep">
|
|
|
- <div id="editor" class="my-editor-content">
|
|
|
- </div>
|
|
|
+ <div>
|
|
|
+ <div ref="editor" style="text-align:left"></div>
|
|
|
+ <button v-on:click="getContent">查看内容</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="exersices-option">
|
|
@@ -63,36 +63,58 @@
|
|
|
</div>
|
|
|
<div class="exersices-analysis">
|
|
|
<IconText :text="'解析'" :color="'#2892DD'" :icon="'md-list'" style="margin-bottom:15px;"></IconText>
|
|
|
+ <div id="toolbar-container"></div>
|
|
|
+ <div id="editor" class="my-editor-content">
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import IconText from '@/components/evaluation/IconText.vue'
|
|
|
+ import InlineEditor from '@ckeditor/ckeditor5-build-inline'
|
|
|
+ import '@ckeditor/ckeditor5-build-inline/build/translations/zh-cn'
|
|
|
+ import '@ckeditor/ckeditor5-build-inline/build/translations/zh'
|
|
|
+ import CKUploadAdapter from '@/utils/CKUploadAdapter'
|
|
|
+ import E from 'wangeditor'
|
|
|
export default {
|
|
|
components: {
|
|
|
IconText,
|
|
|
},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- exersicesType: '',
|
|
|
- exersicesDiff:'',
|
|
|
- exersicesOptions: [
|
|
|
- "",
|
|
|
- "",
|
|
|
- "",
|
|
|
- ""
|
|
|
- ],
|
|
|
- editorContent:"",
|
|
|
- editor: null
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
-
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ exersicesType: '',
|
|
|
+ exersicesDiff:'',
|
|
|
+ exersicesOptions: [
|
|
|
+ "",
|
|
|
+ "",
|
|
|
+ "",
|
|
|
+ ""
|
|
|
+ ],
|
|
|
+ editors: {
|
|
|
+ inline: InlineEditor
|
|
|
+ },
|
|
|
+ editorContent:"",
|
|
|
+ editor: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getContent: function () {
|
|
|
+ alert(this.editorContent)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ let editor = new E(this.$refs.editor)
|
|
|
+ editor.customConfig.onchange = (html) => {
|
|
|
+ this.editorContent = html
|
|
|
+ },
|
|
|
+ editor.customConfig.uploadImgServer = '/api/file/uploadWangEditor'
|
|
|
+ editor.customConfig.showLinkImg = false;
|
|
|
+ editor.customConfig.uploadFileName = 'files'
|
|
|
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- }
|
|
|
+ editor.create()
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
+ @import"../index/CreateExercises.css";
|
|
|
</style>
|