-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用yjs开启协同之后,如何将自定义的数据渲染到编辑器中,开启协同的时候好像编辑器重置了,该如何自定义内容 #166
Labels
Comments
|
你指的是server端的startServer这个方法吗,这个方法需要提前内置内容才可以吧,我想实现的在编辑器开启协同之后,通过外部接口或者其他地方获取的数据渲染到编辑器中,如果使用服务端的方法,该如何动态传递给他 @big-camel |
api清除掉编辑内的所有内容,然后再插入内容,这个该如何操作 @big-camel |
import startServer from '@editablejs/yjs-websocket/server'
startServer({
initialValue: {
children: [
// 启用标题插件下的默认值
{
type: 'title',
children: [{ text: '' }],
},
{
type: 'paragraph',
children: [{ text: '' }],
},
],
},
}) 你可以看下api或者源代码 |
这一段看到了,这一段是在服务端的😂,没找到在编辑器段可以直接修改的api |
先设置 selection 为全选,可以调用删除相关的api(deleteForward deleteBackward) 或者 insertFragment 插入新的 |
如何主动获取到协同编辑的所有协作者的信息,有api可以使用吗 |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: