+
95
-

回答

新增一个div

<div class="my-panel gjs-pn-panel ">


</div>

css

.my-panel{
position: absolute;
z-index:4;
right: 0;
top: 40px;
height: calc(100% - 40px);
width: 15%;
}

js

const myPanel = editor.Panels.addPanel({
id: 'my-panel',
el: '.my-panel',
visible: true,
});

pannel显示与隐藏代码

const myPanel = editor.Panels.getPanel('my-panel');
myPanel && myPanel.set('visible', false);//改成true为显示


网友回复

我知道答案,我要回答