From f28212f9332e9f536658ea03937c533bac205b60 Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 4 May 2023 14:58:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dscoped=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 | 10 ++++++++-- package.json | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/compile-vue.js b/lib/compile-vue.js index 74bfc43..cd7e016 100644 --- a/lib/compile-vue.js +++ b/lib/compile-vue.js @@ -72,8 +72,14 @@ function scopeCss(css = '', hash) { output = `${last} ${output}` } } else { - if (last.startsWith(':')) { - output = parseVDeep(last, output) + if (last.includes(':')) { + if (last.startsWith(':')) { + output = parseVDeep(last, output) + } else { + scoped = true + last = last.replace(':', `[data-${hash}]:`) + output = `${last} ${output}` + } } else { scoped = true output = `${last}[data-${hash}] ${output}` diff --git a/package.json b/package.json index 5f359b1..6dc91c4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "fite", "type": "module", - "version": "0.7.4", + "version": "0.7.5", "bin": { "fite": "index.js" },