cione-comp-lib
Version:
`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`
69 lines (68 loc) • 1.97 kB
JavaScript
import { defineComponent, onMounted, nextTick, watch, toRefs, openBlock, createElementBlock, normalizeStyle, createCommentVNode } from "vue";
import Prism from "../../node_modules/prismjs/prism.mjs";
import "./index.vue_vue_type_style_index_0_scoped_true_lang.mjs";
import _export_sfc from "../../_virtual/plugin-vue_export-helper.mjs";
const _sfc_main = defineComponent({
name: "CoEditorRichText",
props: {
src: {
type: String
},
width: {
type: String
},
height: {
type: String
},
editorType: {
type: String,
default: "richText"
},
content: {
type: String,
default: ""
},
fontFamily: {
type: String
}
},
setup(props) {
onMounted(() => {
nextTick(() => {
Prism.highlightAll();
});
});
watch(
() => props.content,
() => {
nextTick(() => {
Prism.highlightAll();
});
}
);
return {
...toRefs(props)
};
}
});
const _hoisted_1 = ["innerHTML"];
const _hoisted_2 = ["innerHTML"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", {
class: "co-editor-rich-text",
style: normalizeStyle({ width: _ctx.width || "100%", height: _ctx.height || "100%", fontFamily: _ctx.fontFamily })
}, [
_ctx.editorType === "richText" ? (openBlock(), createElementBlock("div", {
key: 0,
class: "editor-rich-text__box",
innerHTML: _ctx.content
}, null, 8, _hoisted_1)) : createCommentVNode("", true),
_ctx.editorType === "html" ? (openBlock(), createElementBlock("div", {
key: 1,
class: "editor-rich-text__box",
innerHTML: _ctx.content
}, null, 8, _hoisted_2)) : createCommentVNode("", true)
], 4);
}
var CoEditorRichText = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4466b781"]]);
export { CoEditorRichText as default };