From 574dd7e693efcf99ae6d77b84f4057503a9e05a8 Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 27 Apr 2023 15:46:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96style[scoped]=E7=9A=84?= =?UTF-8?q?=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/compile-vue.js | 8 ++++++-- package.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/compile-vue.js b/lib/compile-vue.js index 3397212..af013f3 100644 --- a/lib/compile-vue.js +++ b/lib/compile-vue.js @@ -54,8 +54,12 @@ function scopeCss(css = '', hash) { if (last.includes(':')) { let res = V_DEEP.exec(last) if (res) { - last = tmp.pop() - last += `[data-${hash}] ` + res[1] + if (tmp.length) { + last = tmp.pop() + last += `[data-${hash}] ` + } else { + last = res[1] + } } else { if (last.startsWith(':')) { let _prev = tmp.pop() diff --git a/package.json b/package.json index 174a6ca..45bfbdd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "fite", "type": "module", - "version": "0.7.2", + "version": "0.7.3", "bin": { "fite": "index.js" },