performance-helper 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/index.js +3 -3
- package/package.json +1 -1
package/dist/utils/index.js
CHANGED
|
@@ -158,13 +158,13 @@ export function highlightElement(element, options) {
|
|
|
158
158
|
// 设置高亮样式
|
|
159
159
|
const { borderColor = '#ff0000', borderWidth = '3px', backgroundColor = 'rgba(255, 255, 0, 0.2)', scrollIntoView = true, } = options || {};
|
|
160
160
|
// 保存原始样式
|
|
161
|
-
const
|
|
161
|
+
const originalBorder = element.style.border;
|
|
162
162
|
const originalBoxShadow = element.style.boxShadow;
|
|
163
163
|
const originalBackgroundColor = element.style.backgroundColor;
|
|
164
164
|
const originalZIndex = element.style.zIndex;
|
|
165
165
|
const originalPosition = element.style.position;
|
|
166
166
|
// 应用高亮样式
|
|
167
|
-
element.style.
|
|
167
|
+
element.style.border = `${borderWidth} solid ${borderColor}`;
|
|
168
168
|
element.style.boxShadow = `0 0 0 ${borderWidth} ${borderColor}`;
|
|
169
169
|
element.style.backgroundColor = backgroundColor;
|
|
170
170
|
element.style.zIndex = '9999';
|
|
@@ -177,7 +177,7 @@ export function highlightElement(element, options) {
|
|
|
177
177
|
}
|
|
178
178
|
// 返回移除高亮的函数
|
|
179
179
|
return () => {
|
|
180
|
-
element.style.
|
|
180
|
+
element.style.border = originalBorder;
|
|
181
181
|
element.style.boxShadow = originalBoxShadow;
|
|
182
182
|
element.style.backgroundColor = originalBackgroundColor;
|
|
183
183
|
element.style.zIndex = originalZIndex;
|