wangeditor-team / wangeditor-for-vue3 Goto Github PK
View Code? Open in Web Editor NEWwangEditor v5 Vue3 component
Home Page: https://www.wangeditor.com/
wangEditor v5 Vue3 component
Home Page: https://www.wangeditor.com/
编辑器能正常显示,也能正常输入内容,获取到输入内容的值,初始化的时候无法显示初始值。
初始化的时候报如下异常,查看代码 tokenizePlaceholders 是 prism 里面的。
Uncaught TypeError: Cannot read properties of undefined (reading 'tokenizePlaceholders')
vue3+ts我引入就给我提示没有找到wangeditor的声明文件,官方有提供吗,还是需要自己声明
V5.1.9会报以下错误:
The requested module '/node_modules/.vite/deps/@wangeditor_editor-for-vue.js?v=c9b4b35f' does not provide an export named 'getEditor' (at Editor.vue:24:1)
提供的demo可复现这个问题。
https://github.com/liuqh0609/editor-vue3-demo
这个demo的yarn.lock锁了5.1.8版本,需要手动升级一下才能复现这个问题
可以看一下vue的问题 vuejs/core#5584
官方虽然通过插件的形式,可以解决问题。
wangeditor-team/wangEditor#4619
是否考虑集成至wangEditor-for-vue3这个组件中?
系统:ubuntu20.04
浏览器:chrome Version 100.0.4896.60
复现步骤,https://www.wangeditor.com/v5/for-frame.html#%E4%BD%BF%E7%94%A8-1
导入模板和script就可以复现
有些链接需要在当前页面跳转, 怎么设置a标签的其他属性呢?
vite2.8 vue3.2
安装了@wangeditor/editor-for-vue@next
编辑器的config里面全是这个。
arguments: [Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.invokeGetter (:2:14)]
自定义粘贴和自定义弹窗都失效
import {useWindowSize, useElementBounding, toValue} from '@vueuse/core'
/**
* 编辑器自适应高度
*
* @export
* @param {HTMLElement} selector
*/
export function useAutoHeight(selector: HTMLElement) {
if (selector) {
setTimeout(() => {
const { height: windowHeight } = useWindowSize()
// scroll 元素 w-e-text-container
const scrollElement = selector.firstChild as HTMLElement
// 记录 windowHeight
const lastWindowHeight = ref(toValue(windowHeight))
// 初始化 scroll 元素 height
const { height: scrollHeight } = useElementBounding(scrollElement)
scrollElement.style.height = `${toValue(scrollHeight)}px`
// 监听 windowHeight
watch(windowHeight, (height) => {
const changeHeight = toValue(height) - toValue(lastWindowHeight)
lastWindowHeight.value = toValue(height)
scrollElement.style.height = `${toValue(scrollHeight) + changeHeight}px`
})
})
}
}
+ // 编辑器自适应高度 - onCreated 前初始化编辑区域高、监听 resize
+ useAutoHeight(box.value)
context.emit('onCreated', editor)
const handleCreated = (editor) => {
editorRef.value = editor // 记录 editor 实例,重要!
valueHtml.value = '<p>初始化编辑器内容</p>'
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.