Closed likedream11 closed 1 year ago
好吧,我依靠示例自己封装了个组件,大家也自己封装吧,
Hi likedream11, you can pass event to config like so:
var onRequestUsers = function (event) {
var editor = window.DocEditor.instances[args.id];
editor.setUsers({
"c": event.data.c,
"users": [
{
"email": "john@example.com",
"id": "78e1e841",
"name": "John Smith"
},
{
"email": "kate@example.com",
"id": "F89d8069ba2b",
"name": "Kate Cage"
}
]
});
};
<DocumentEditor
config={{
events: {
onRequestUsers: onRequestUsers
}
}}
/>
</div>
)}
Detailed documentation on this method you can find here (https://api.onlyoffice.com/editors/config/events#onRequestUsers)
I didn't find 'events_onRequestUsers'