"use document"; let style = document.createElement('style'); style.type = 'text/css'; style.appendChild( document.createTextNode(`.bi-popup-view.bi-v{ width: auto !important;} `)); document.head.appendChild(style); 利用上面的js,可以让下拉树的下拉列表根据显示出来的内容的长度变化宽度 问题是:同时有下拉树和复选下拉框(复选下拉框下拉列表的宽度不够),怎么让复选下拉框的下拉列表的宽度根据下拉选项变化 在上面的js中添加了min-width: 300px !important; 后把所有有下拉框的都设置成300了 想要所有的下拉列表的宽度都根据他下拉选项的来变化 添加 min-width: auto !important |