feat: downgrade tinymce and fix editor config
This commit is contained in:
@ -115,7 +115,7 @@ export default defineNuxtConfig({
|
||||
},
|
||||
|
||||
build: {
|
||||
transpile: ["vueuc", "@css-render/vue3-ssr","@unocss"],
|
||||
transpile: ["vueuc", "@css-render/vue3-ssr","@unocss","@tinymce/tinymce-vue","tinymce"],
|
||||
},
|
||||
plugins: [
|
||||
// 在这里引入插件
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
"dependencies": {
|
||||
"@nuxtjs/axios": "^5.13.6",
|
||||
"@pinia/nuxt": "^0.11.2",
|
||||
"@tinymce/tinymce-vue": "^6.3.0",
|
||||
"@tinymce/tinymce-vue": "^5.0.0",
|
||||
"@types/tinymce": "^5.5.0",
|
||||
"decimal.js": "^10.6.0",
|
||||
"echarts": "^6.0.0",
|
||||
@ -20,7 +20,7 @@
|
||||
"nuxt": "^3.18.1",
|
||||
"pdfjs-dist": "^5.4.54",
|
||||
"pinia": "^3.0.3",
|
||||
"tinymce": "^8.0.2",
|
||||
"tinymce": "^6.2.0",
|
||||
"vue": "^3.5.18",
|
||||
"vue-pdf-embed": "^2.1.3",
|
||||
"vue-router": "^4.5.1",
|
||||
|
||||
@ -36,16 +36,18 @@
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
|
||||
<ClientOnly>
|
||||
<Editor :id="tinymceId" v-model="myValue" :init="init" :disabled="disabled" :placeholder="placeholder" />
|
||||
</ClientOnly>
|
||||
<!-- 按钮区域 -->
|
||||
<div class="mt-[20px] flex justify-end">
|
||||
<el-button :loading="post_loading" class="mr-[10px]" @click="previewContent">预览</el-button>
|
||||
<el-button :loading="post_loading" type="primary" @click="saveContent">发表</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup lang="ts">
|
||||
import { keywords } from '~/api/upnew/index'
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
@ -74,6 +76,10 @@
|
||||
import 'tinymce/plugins/advlist' //列
|
||||
import 'tinymce/plugins/quickbars' //快速工具条
|
||||
import 'tinymce/plugins/wordcount' // 字数统计插件
|
||||
// import 'tinymce/langs/zh-Hans'
|
||||
// import 'tinymce/skins/ui/oxide/skin.min.css'
|
||||
// import 'tinymce/skins/ui/oxide/content.min.css'
|
||||
// import 'tinymce/skins/content/default/content.css'
|
||||
// import '~/assets/tinymce/langs/zh-Hans.js' //下载后的语言包
|
||||
// import 'tinymce/skins/content/default/content.css'
|
||||
// 获取从其他地方传过来的参数
|
||||
@ -121,10 +127,10 @@
|
||||
const tinymceId = ref('vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + ''))
|
||||
const init = reactive({
|
||||
selector: '#' + tinymceId.value, //富文本编辑器的id,
|
||||
language_url: '~/staic/tinymce/langs/zh_CN.js', // 语言包的路径,具体路径看自己的项目,文档后面附上中文js文件
|
||||
language_url: '/_nuxt/static/tinymce/langs/zh_CN.js', // 语言包的路径,具体路径看自己的项目,文档后面附上中文js文件
|
||||
language: 'zh-Hans', //语言
|
||||
skin_url: '~/staic/tinymce/skins/ui/oxide', // skin路径,具体路径看自己的项目
|
||||
content_css: '~/staic/tinymce/skins/content/default/content.css',
|
||||
skin_url: '/_nuxt/static/tinymce/skins/ui/oxide', // skin路径,具体路径看自己的项目
|
||||
content_css: '/_nuxt/static/tinymce/skins/content/default/content.css',
|
||||
menubar: true, //顶部菜单栏显示
|
||||
statusbar: true, // 底部的状态栏
|
||||
plugins: props.plugins,
|
||||
@ -272,7 +278,7 @@
|
||||
}
|
||||
}
|
||||
//在onMounted中初始化编辑器
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
if (process.client) {
|
||||
getParent()
|
||||
getChannelIdList()
|
||||
@ -321,9 +327,9 @@
|
||||
labelsList.value = []
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style scoped>
|
||||
.custom-form {
|
||||
border: 2px solid #eeeeee;
|
||||
border-radius: 4px;
|
||||
@ -371,5 +377,4 @@
|
||||
.text-12px {
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</style>
|
||||
0
plugins/tinymce.ts
Normal file
0
plugins/tinymce.ts
Normal file
18
yarn.lock
18
yarn.lock
@ -1730,10 +1730,12 @@
|
||||
resolved "https://registry.npmmirror.com/@speed-highlight/core/-/core-1.2.7.tgz"
|
||||
integrity sha512-0dxmVj4gxg3Jg879kvFS/msl4s9F3T9UXC1InxgOf7t5NvcPD97u/WTA5vL/IxWHMn7qSxBozqrnnE2wvl1m8g==
|
||||
|
||||
"@tinymce/tinymce-vue@^6.3.0":
|
||||
version "6.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@tinymce/tinymce-vue/-/tinymce-vue-6.3.0.tgz#1ea4d57eea71e48aa71da9d8de98472f8505b2d4"
|
||||
integrity sha512-DSP8Jhd3XqCCliTnusfbmz3D8GqQ4iRzkc4aadYHDcJPVjkaqopJ61McOdH82CSy599vGLkPjGzqJYWJkRMiUA==
|
||||
"@tinymce/tinymce-vue@^5.0.0":
|
||||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@tinymce/tinymce-vue/-/tinymce-vue-5.1.1.tgz#0879787e07833a4316b2eaf0417c7c6a2abce86b"
|
||||
integrity sha512-iO57HOWesFOhsaqjA5Ea6sDvQBmJJH3/dq00Uvg7metlct2kLF+ctRgoDsetLt6gmeZ7COPftr814/XzqnJ/dg==
|
||||
dependencies:
|
||||
tinymce "^6.0.0 || ^5.5.1"
|
||||
|
||||
"@tybys/wasm-util@^0.10.0":
|
||||
version "0.10.0"
|
||||
@ -6479,10 +6481,10 @@ tinymce@*:
|
||||
resolved "https://registry.npmmirror.com/tinymce/-/tinymce-8.0.2.tgz#babaaa40c154d0832b41332f25f3485b5887a6f2"
|
||||
integrity sha512-Gkvn5mRcZCAK1EKP7hnk3VBzwqPbqpZU2AN0T08BMtvmY9Sg0C0ZqmMghJCQ3vgo+LWA38pDOPiaM8EW7BZEow==
|
||||
|
||||
tinymce@^8.0.2:
|
||||
version "8.0.2"
|
||||
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-8.0.2.tgz#babaaa40c154d0832b41332f25f3485b5887a6f2"
|
||||
integrity sha512-Gkvn5mRcZCAK1EKP7hnk3VBzwqPbqpZU2AN0T08BMtvmY9Sg0C0ZqmMghJCQ3vgo+LWA38pDOPiaM8EW7BZEow==
|
||||
"tinymce@^6.0.0 || ^5.5.1", tinymce@^6.2.0:
|
||||
version "6.8.6"
|
||||
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-6.8.6.tgz#799e4f03eeb4399399dfdeb12ba17b3b91887adf"
|
||||
integrity sha512-++XYEs8lKWvZxDCjrr8Baiw7KiikraZ5JkLMg6EdnUVNKJui0IsrAADj5MsyUeFkcEryfn2jd3p09H7REvewyg==
|
||||
|
||||
tmp-promise@^3.0.2:
|
||||
version "3.0.3"
|
||||
|
||||
Reference in New Issue
Block a user