控件创建和权限API优化

This commit is contained in:
猴赛雷 2024-04-29 11:17:44 +08:00
parent 02daec008a
commit 3e0843ed74
2 changed files with 19 additions and 2 deletions

View File

@ -137,8 +137,11 @@ export default defineComponent({
}) })
const options2 = markRaw({ const options2 = markRaw({
config: { config: {
"readonly": true, EXT_STAGE_WIDTH:false,
// "readonly": true,
access:{"DEL":false},
"paper":"A5", "paper":"A5",
"ruler": true, "ruler": true,
controls: [ controls: [

View File

@ -98,8 +98,22 @@ export default {
this.editor.bindEvent(); this.editor.bindEvent();
this.editor.changeTheme(''); this.editor.changeTheme('');
DDeiEditorUtil.getControlIcons(this.editor); DDeiEditorUtil.getControlIcons(this.editor);
//
if(this.options?.config?.controls){ if(this.options?.config?.controls){
this.editor.addControls(this.options?.config?.controls) //
let controls = this.options?.config?.controls;
let converters = this.editor.getEnabledConverters(controls, 1);
//converters
converters?.forEach(converter => {
controls = converter.input(controls)
});
this.editor.addControls(controls)
}
if (this.options?.config?.access){
this.editor.setAccessInfo(this.options?.config?.access)
} else if (this.options?.config?.readonly == true || this.options?.config?.readonly == false) {
this.editor.setEditable(false)
} }
// //