Skip to content

Commit

Permalink
fix(core): 将 dropdown 的 opiton 元素改成 div 元素
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Apr 3, 2023
1 parent 53043d1 commit 5a8877e
Show file tree
Hide file tree
Showing 3 changed files with 509 additions and 518 deletions.
7 changes: 2 additions & 5 deletions packages/core/src/render/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export const RenderScript = new Script({

let selected = false;

const options: HTMLOptionElement[] = [];
const options: HTMLDivElement[] = [];

// 如果整个工程下面有一个需要显示的脚本,那此工程就添加到头部
const scripts = $.getMatchedScripts([project], urls).filter((s) => !s.hideInPanel);
Expand All @@ -161,10 +161,7 @@ export const RenderScript = new Script({
// 只显示需要显示的面板
if (!script.hideInPanel) {
const optionSelected = isCurrentPanel(project.name, script, currentPanelName);
const option = el('option', {
value: project.name + '-' + script.name,
label: script.name
});
const option = el('div', { className: 'dropdown-option' }, script.name);

if (optionSelected) {
option.classList.add('active');
Expand Down
Loading

0 comments on commit 5a8877e

Please sign in to comment.