From 4aa86b1ec441c4e358e1cc488d8f021fb80f1355 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期三, 17 九月 2025 17:34:35 +0800 Subject: [PATCH] 2025.9.17 数据产品(待完成) --- src/utils/css-util.js | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/src/utils/css-util.js b/src/utils/css-util.js new file mode 100644 index 0000000..bf826b1 --- /dev/null +++ b/src/utils/css-util.js @@ -0,0 +1,21 @@ +/** + * 鎻愬彇css涓甫鏈塩alc鍑芥暟鐨勮〃杈惧紡鐨勫弬鏁伴儴鍒� + * @param {String} str css涓甫鏈塩alc鍑芥暟鐨勮〃杈惧紡 + */ +function unCalc(str) { + if (str.startsWith('calc(')) { + let _str = str.replace('calc(', '') + _str = _str.replace(/\)/g, (match, offset, string) => { + if (offset === string.lastIndexOf(match)) { + return '' + } else { + return match + } + }) + return _str + } else { + return str + } +} + +export { unCalc } -- Gitblit v1.9.3