Skip to content

Commit 02013b4

Browse files
committed
fix: 修复纯数字解析负数异常
1 parent ea425a2 commit 02013b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/style_propetries/unit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub fn generate_expr_with_css_input(input: String, platform: Platform) -> Expr {
168168
if let Ok(caps) = re.captures(bytes) {
169169
if let Some(caps) = caps {
170170
// 提取匹配到的数字部分
171-
let input_str = std::str::from_utf8(&caps["num"]);
171+
let input_str = std::str::from_utf8(&caps[0]);
172172
let unit = match std::str::from_utf8(&caps["unit"]) {
173173
Ok(s) => s,
174174
Err(_) => "vp",

0 commit comments

Comments
 (0)