Commit 9a133f87 by qlintonger xeno

feat: 想继续添加完毕

parent 8b3c04d5
...@@ -30,6 +30,12 @@ const routes: Array<RouteRecordRaw> = [ ...@@ -30,6 +30,12 @@ const routes: Array<RouteRecordRaw> = [
name: 'Editor', name: 'Editor',
component: () => import(/* webpackChunkName: "Editor" */ '@/views/editor/index.vue'), component: () => import(/* webpackChunkName: "Editor" */ '@/views/editor/index.vue'),
meta: { title: '在线编辑器' } meta: { title: '在线编辑器' }
},
{
path: '/cpt',
name: 'CPT',
component: () => import(/* webpackChunkName: "Editor" */ '@/views/Compare/index.vue'),
meta: { title: '示例对比' }
} }
] ]
}, },
......
<template>
<div ref="view" class="w-full h-full"></div>
</template>
<script lang="ts" setup>
const view = ref()
import TextA from '@/assets/file/Trans-Convert.xml?raw'
import TextB from '@/assets/file/CES-QEC-V250-A.xml?raw'
import { CodeMirror, vkbeautify } from './lib/CodeMirror.js';
onMounted(function () {
console.log('the code mirror', CodeMirror)
const mv = CodeMirror.MergeView(view.value, {
value: TextA,
origLeft: null,
orig: TextB,
lineNumbers: true,
mode: 'application/xml',
showDifferences: true,
connect: 'align',
collapseIdentical: false,
revertButtons: true,
allowEditingOriginals: true,
chunkClassLocation: ['background', 'wrap', 'gutter']
});
mv.editor().setValue(vkbeautify.xml(TextA));
mv.rightOriginal().setValue(vkbeautify.xml(TextB));
})
</script>
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment