dev
suixy 2 months ago
parent a2a532bd71
commit b9de90424d

@ -1,6 +1,6 @@
<template>
<div>
{{ options }}
<!-- {{ options }}-->
<umo-editor v-bind="options" ref="editorRef" />
</div>
</template>
@ -122,10 +122,10 @@ const createContractTable = () => {
};
};
const options = ref({
document: {
title: '',
content: {
type: 'doc',
templates: [
{
title: '合同',
description: '合同',
content: [
{
type: 'heading',
@ -253,6 +253,13 @@ const options = ref({
content: [{ type: 'text', text: `\t日期\t\t\t\t\t\t\t日期` }]
}
]
}
],
document: {
title: '',
content: {
type: 'doc',
content: []
},
placeholder: {
en_US: 'Please enter the document content...',
@ -276,23 +283,22 @@ const options = ref({
}
},
onSave: async (e) => {
const editor = editorRef.value;
const html = editor.getHTML();
console.log(html);
console.log(e);
// const editor = editorRef.value;
// const html = editor.getHTML();
// console.log(html);
// const doc = new Document({
// sections: [{ children: parseHTML(editor.getHTML()) }]
// });
// await download(doc);
},
onChanged: async (e) => {
const editor = editorRef.value;
const json = editor.getJSON();
console.log(json);
console.log(json.content.find((v) => v.type === 'table' && v.attrs?.id === 'contractTable'));
// const editor = editorRef.value;
// const json = editor.getJSON();
// console.log(json);
// console.log(json.content.find((v) => v.type === 'table' && v.attrs?.id === 'contractTable'));
// json
editor.setContent(json, { emitUpdate: false });
// editor.setContent(json, { emitUpdate: false });
// const doc = new Document({
// sections: [{ children: prseHTML(editor.getHTML()) }]
// });

@ -1,4 +1,5 @@
import { defineConfig, loadEnv } from 'vite';
import basicSsl from '@vitejs/plugin-basic-ssl';
import createPlugins from './vite/plugins';
import autoprefixer from 'autoprefixer'; // css自动添加兼容性前缀
import path from 'path';
@ -17,16 +18,18 @@ export default defineConfig(({ mode, command }) => {
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
},
// https://cn.vitejs.dev/config/#resolve-extensions
plugins: createPlugins(env, command === 'build'),
plugins: [createPlugins(env, command === 'build'), basicSsl()],
server: {
host: '0.0.0.0',
https: true,
port: Number(env.VITE_APP_PORT),
open: true,
proxy: {
[env.VITE_APP_BASE_API]: {
target: 'http://localhost:8080',
target: 'https://frp-off.com:47543',
changeOrigin: true,
ws: true,
secure: false,
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
}
}

Loading…
Cancel
Save