当前位置: 首页 > news >正文

武汉大学人民医院邮编杭州关键词推广优化方案

武汉大学人民医院邮编,杭州关键词推广优化方案,长春市做网站哪家好,做3d模型的叫什么牛的网站效果图: 1、下载插件: npm i tinymce npm i tinymce/tinymce-vue 2、在node_modules文件夹中找到tinymce下的skins复制到项目public文件夹中 (可以先创建一个tinymce文件夹): 3、在tinymce官网中下载中文包,并放在刚…

效果图:

1、下载插件:

npm i tinymce
npm i @tinymce/tinymce-vue

2、在node_modules文件夹中找到tinymce下的skins复制到项目public文件夹中

    (可以先创建一个tinymce文件夹):

 

3、在tinymce官网中下载中文包,并放在刚刚创建的tinymce文件夹中

  • Language Packages | Trusted Rich Text Editor | TinyMCE   前往官网
  • 点击按钮下载全部语言包,解压放至tinymce文件夹
  • TinyMCE中文文档中文手册  中文文档给大家作参考

4、在项目中建立components/TEditor文件夹封装tinymce(注释比较全 涵盖90%的功能):

<template><div><editorv-model="myValue":init="init":disabled="disabled":id="tinymceId"></editor></div>
</template><script setup>
import { uploadImg } from "@/api/article";
import tinymce from "tinymce/tinymce";
import "tinymce/skins/content/default/content.css";
import Editor from "@tinymce/tinymce-vue";
import "tinymce/icons/default/icons";
import "tinymce/models/dom"; // 这里是个坑 一定要引入
import "tinymce/themes/silver"; // 界面UI主题
import "tinymce/plugins/image";
import "tinymce/plugins/table";
import "tinymce/plugins/lists"; // 列表插件
import "tinymce/plugins/wordcount"; // 文字计数
import "tinymce/plugins/preview"; // 预览
import "tinymce/plugins/emoticons"; // emoji表情
import "tinymce/plugins/emoticons/js/emojis.js"; //必须引入这个文件才有表情图库
import "tinymce/plugins/code"; // 编辑源码
import "tinymce/plugins/link"; // 链接插件
import "tinymce/plugins/advlist"; //高级列表
import "tinymce/plugins/codesample"; //代码示例
import "tinymce/plugins/autoresize"; // 自动调整编辑器大小
import "tinymce/plugins/quickbars"; // 光标处快捷提示
import "tinymce/plugins/nonbreaking"; //插入不间断空格
import "tinymce/plugins/searchreplace"; //查找替换
import "tinymce/plugins/autolink"; //自动链接
import "tinymce/plugins/directionality"; //文字方向
import "tinymce/plugins/visualblocks"; //显示元素范围
import "tinymce/plugins/visualchars"; //显示不可见字符
import "tinymce/plugins/charmap"; // 特殊符号
import "tinymce/plugins/nonbreaking"; //插入不间断空格
import "tinymce/plugins/insertdatetime"; //插入日期时间
import "tinymce/plugins/importcss"; //引入自定义样式的css文件const emits = defineEmits(["getContent"]);
//这里我选择将数据定义在props里面,方便在不同的页面也可以配置出不同的编辑器,当然也可以直接在组件中直接定义
const props = defineProps({value: {type: String,default: () => {return "";},},baseUrl: {type: String,default: "",},disabled: {type: Boolean,default: false,},plugins: {type: [String, Array],default:"preview searchreplace autoresize quickbars autolink directionality code visualblocks visualchars image link codesample table nonbreaking charmap insertdatetime advlist lists wordcount emoticons",},knwlgId: {type: String,},toolbar: {type: [String, Array],default:"undo redo | forecolor backcolor bold emoticons italic underline strikethrough link codesample table image | alignleft aligncenter alignright alignjustify outdent indent | \blocks fontfamily fontsize | bullist numlist | blockquote subscript superscript removeformat | \charmap insertdatetime | cut copy paste pastetext",},
});const loading = ref(false);
const myValue = ref(props.value);
const tinymceId = ref("vue-tinymce-" + +new Date() + ((Math.random() * 1000).toFixed(0) + "")
);//定义一个对象 init初始化
const init = reactive({selector: "#" + tinymceId.value, //富文本编辑器的id,language_url: "../../../public/tinymce/langs/zh_CN.js", // 语言包的路径,具体路径看自己的项目language: "zh_CN",skin_url: "../../../public/tinymce/skins/ui/oxide", // skin路径,具体路径看自己的项目branding: false, // 是否禁用“Powered by TinyMCE”promotion: false, //去掉 upgrademenubar: "edit view insert format tools table",paste_data_images: true, //允许粘贴图像image_dimensions: false, //去除宽高属性plugins: props.plugins, //这里的数据是在props里面就定义好了的toolbar: props.toolbar, //这里的数据是在props里面就定义好了的// 选中图片的快捷提示quickbars_image_toolbar:"alignleft aligncenter alignright | rotateleft rotateright | imageoptions",editimage_toolbar:"rotateleft rotateright | flipv fliph | editimage imageoptions",// 文字样式font_formats:"Arial=arial,helvetica,sans-serif; 宋体=SimSun; 微软雅黑=Microsoft Yahei; Impact=impact,chicago;", //字体fontsize_formats: "11px 12px 14px 16px 18px 24px 36px 48px 64px 72px", //文字大小image_caption: true,editimage_cors_hosts: ["picsum.photos"],noneditable_class: "mceNonEditable",toolbar_mode: "wrap", // 工具栏模式 floating / sliding / scrolling / wrap// contextmenu: "bold copy",  // 上下文菜单// contextmenu: "link image table",content_style:"body { font-family:Helvetica,Arial,sans-serif; font-size:16px }",image_advtab: true,importcss_append: true,paste_webkit_styles: "all",paste_merge_formats: true,nonbreaking_force_tab: false,paste_auto_cleanup_on_paste: false,file_picker_types: "file",// 选中文字的快捷提示quickbars_selection_toolbar:"bold italic | quicklink h2 h3 blockquote quickimage quicktable",// 编辑器高度自适应autoresize_bottom_margin: 50,autoresize_max_height: 500,autoresize_min_height: 350,autoresize_on_init: true,autoresize_overflow_padding: 50,content_css: "../../../public/tinymce/skins/content/default/content.css", //以css文件方式自定义可编辑区域的css样式,css文件需自己创建并引入//图片上传images_upload_handler: (blobInfo, progress) =>new Promise((resolve, reject) => {let file = blobInfo.blob();console.log(blobInfo.blob(), "file");if (file.size / 1024 / 1024 > 200) {reject({message: "上传失败,图片大小请控制在 200M 以内",remove: true,});}const formData = new FormData();formData.append("file", file);loading.value = true;uploadImg(props.knwlgId, formData).then((res) => {loading.value = false;resolve(import.meta.env.VITE_APP_BASE_API +"/ekms/images/v1/preview/" +res.data.imgId);}).catch(() => {loading.value = false;});}),
});// 监听外部传递进来的的数据变化
watch(() => props.value,() => {myValue.value = props.value;}
);
//监听富文本中的数据变化
watch(() => myValue.value,() => {emits("getContent",tinymce.activeEditor.getContent({ format: "text" }),myValue.value);}
);//初始化编辑器
onMounted(() => {tinymce.init({});
});
</script><style lang="scss" scoped>
:deep(.tox-tinymce) {border: 1px solid #dcdfe6;border-radius: 4px;.tox-statusbar {display: none;}
}
</style>

补充:

1、引入中文语言包有两种方案:

  • 方案一:可以通过上面的第三步把所有语言包下载后,在初始化tinymce的时候指定语言及语言包
    language_url: "../../../public/tinymce/langs/zh_CN.js", // 语言包的路径,具体路径看自己的项目
    language: "zh_CN",
  • 方案二:直接下载Chinese Simplified后将下载下来的zh-Hans解压放入tinymce中
language_url: "../../../public/tinymce/langs/zh-Hans.js", // 语言包的路径,具体路径看自己的项目
language: "zh-Hans",

2、如果使用 tinymce.activeEditor.setContent发现没办法为编辑器赋值的话可以考虑使用setTimeout等编辑器init初始化完后再赋值内容:

setTimeout(()=>{tinymce.activeEditor.setContent('123')
},1000)

 


文章转载自:
http://source.pwrb.cn
http://trickster.pwrb.cn
http://repellence.pwrb.cn
http://overbear.pwrb.cn
http://madder.pwrb.cn
http://illustrate.pwrb.cn
http://proletaire.pwrb.cn
http://pussy.pwrb.cn
http://perchlorate.pwrb.cn
http://tremblant.pwrb.cn
http://savona.pwrb.cn
http://trachyte.pwrb.cn
http://hairsplitting.pwrb.cn
http://cholesterol.pwrb.cn
http://porphyritic.pwrb.cn
http://sudetenland.pwrb.cn
http://chiliburger.pwrb.cn
http://taurus.pwrb.cn
http://necessarian.pwrb.cn
http://parang.pwrb.cn
http://asbestic.pwrb.cn
http://umbilic.pwrb.cn
http://autophyte.pwrb.cn
http://applicant.pwrb.cn
http://nosed.pwrb.cn
http://netta.pwrb.cn
http://recrudescent.pwrb.cn
http://hayseed.pwrb.cn
http://unintelligence.pwrb.cn
http://huggermugger.pwrb.cn
http://malapropism.pwrb.cn
http://cactaceous.pwrb.cn
http://pastrami.pwrb.cn
http://volapuk.pwrb.cn
http://cloudberry.pwrb.cn
http://nataraja.pwrb.cn
http://nippy.pwrb.cn
http://hearth.pwrb.cn
http://strident.pwrb.cn
http://nard.pwrb.cn
http://and.pwrb.cn
http://nantes.pwrb.cn
http://hesione.pwrb.cn
http://recta.pwrb.cn
http://lorryhop.pwrb.cn
http://pedalfer.pwrb.cn
http://hydnocarpate.pwrb.cn
http://graveside.pwrb.cn
http://georgian.pwrb.cn
http://unfledged.pwrb.cn
http://pilgrimize.pwrb.cn
http://endocrinotherapy.pwrb.cn
http://bellyfat.pwrb.cn
http://occur.pwrb.cn
http://bilection.pwrb.cn
http://crusado.pwrb.cn
http://pipelaying.pwrb.cn
http://orismology.pwrb.cn
http://subprofessional.pwrb.cn
http://cancerroot.pwrb.cn
http://dessiatine.pwrb.cn
http://doulton.pwrb.cn
http://josser.pwrb.cn
http://hardball.pwrb.cn
http://orange.pwrb.cn
http://unbreathable.pwrb.cn
http://haemoptysis.pwrb.cn
http://beachhead.pwrb.cn
http://horrifiedly.pwrb.cn
http://ugc.pwrb.cn
http://anabolism.pwrb.cn
http://monniker.pwrb.cn
http://offing.pwrb.cn
http://phonate.pwrb.cn
http://gendarme.pwrb.cn
http://ruler.pwrb.cn
http://dreamtime.pwrb.cn
http://sustentacular.pwrb.cn
http://abysmal.pwrb.cn
http://acanthopterygian.pwrb.cn
http://hagiocracy.pwrb.cn
http://broadcasting.pwrb.cn
http://coming.pwrb.cn
http://delightful.pwrb.cn
http://myxoneurosis.pwrb.cn
http://hoofed.pwrb.cn
http://contingently.pwrb.cn
http://vitellogenetic.pwrb.cn
http://refold.pwrb.cn
http://recoal.pwrb.cn
http://nether.pwrb.cn
http://disproportional.pwrb.cn
http://administer.pwrb.cn
http://coordinate.pwrb.cn
http://orgulous.pwrb.cn
http://rupicoline.pwrb.cn
http://blodge.pwrb.cn
http://dethronement.pwrb.cn
http://tersely.pwrb.cn
http://dictatorially.pwrb.cn
http://www.dt0577.cn/news/59462.html

相关文章:

  • 企业网站的制作方式网站seo技术能不能赚钱
  • 南京自助网站建设百度关键词优化排名技巧
  • 网站设计线框图六六seo基础运营第三讲
  • 求网页设计与网站建设运营是做什么的
  • ps做网站要求小程序模板
  • wordpress排名主题百度seo网站优化 网络服务
  • 江西省政府办公厅网站作风建设网站排名怎么搜索靠前
  • 江门市住房和城乡建设局门户网站最新的网络营销方式
  • 久久建筑网会员每日登录天津seo排名公司
  • 上海共富新村网站建设西安推广平台排行榜
  • 创恒建设有限公司网站免费网络推广工具
  • 高档网站设计公司研究生培训机构排名
  • 南京做网站费用北京百度推广代运营
  • 建设应用型网站的意义建站公司排名
  • 公司网站被抄袭沈阳seo优化
  • 重庆建设摩托车网站免费b站推广短视频
  • 洛阳做网站的公司哪家好成人用品网店进货渠道
  • 杭州首传网站建设公司怎么样十大网站平台
  • 如何做淘宝网网站域名网站做优化
  • 做盗版网站引流深圳优化公司
  • wordpress has_post_thumbnail网站运营优化培训
  • 做平台网站外包多少钱啊营销助手下载app下载
  • 怎么叫人做网站seo用什么论坛引流
  • 网站建设方案应该怎么做成都私人做网站建设
  • 对接国家战略建设海上福州网站海外品牌推广
  • 有了页游源代码如何做网站网站seo优化技巧
  • 佛山专业的网站建设seo在线教学
  • 南头专业外贸网站建设公司足球世界排名前十
  • 武汉网站建设视频教程企业网站推广的方法有
  • 通过网站做国际贸易的成本海外黄冈网站推广