@sprlab/wccompiler 0.9.8 → 0.9.9
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/integrations/vue.js +5 -4
- package/package.json +1 -1
package/integrations/vue.js
CHANGED
|
@@ -140,7 +140,8 @@ export function wccVuePlugin(options = {}) {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
// Handle scoped slots: <template #name="{ prop1, prop2 }">...</template>
|
|
143
|
-
// → <div slot="name" slot-props="prop1, prop2">content with {%prop%}</div>
|
|
143
|
+
// → <div slot="name" slot-props="prop1, prop2" hidden>content with {%prop%}</div>
|
|
144
|
+
// The 'hidden' attribute prevents {%prop%} tokens from flashing before the WCC runtime processes them.
|
|
144
145
|
// Only inside custom elements (tag names with hyphens)
|
|
145
146
|
prev = ''
|
|
146
147
|
while (prev !== result) {
|
|
@@ -149,13 +150,13 @@ export function wccVuePlugin(options = {}) {
|
|
|
149
150
|
/(<[\w]+-[\w-]*[^>]*>)([\s\S]*?)<template\s+#(\w+)="\{\s*([^}]*)\s*\}">([\s\S]*?)<\/template>/,
|
|
150
151
|
(match, openTag, before, slotName, propsExpr, content) => {
|
|
151
152
|
const { transformed, props } = transformScopedContent(content, propsExpr)
|
|
152
|
-
return `${openTag}${before}<div slot="${slotName}" slot-props="${props.join(', ')}">${transformed}</div>`
|
|
153
|
+
return `${openTag}${before}<div slot="${slotName}" slot-props="${props.join(', ')}" hidden>${transformed}</div>`
|
|
153
154
|
}
|
|
154
155
|
)
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
// Handle scoped slots: <template v-slot:name="{ prop1, prop2 }">...</template>
|
|
158
|
-
// → <div slot="name" slot-props="prop1, prop2">content with {%prop%}</div>
|
|
159
|
+
// → <div slot="name" slot-props="prop1, prop2" hidden>content with {%prop%}</div>
|
|
159
160
|
// Only inside custom elements (tag names with hyphens)
|
|
160
161
|
prev = ''
|
|
161
162
|
while (prev !== result) {
|
|
@@ -164,7 +165,7 @@ export function wccVuePlugin(options = {}) {
|
|
|
164
165
|
/(<[\w]+-[\w-]*[^>]*>)([\s\S]*?)<template\s+v-slot:(\w+)="\{\s*([^}]*)\s*\}">([\s\S]*?)<\/template>/,
|
|
165
166
|
(match, openTag, before, slotName, propsExpr, content) => {
|
|
166
167
|
const { transformed, props } = transformScopedContent(content, propsExpr)
|
|
167
|
-
return `${openTag}${before}<div slot="${slotName}" slot-props="${props.join(', ')}">${transformed}</div>`
|
|
168
|
+
return `${openTag}${before}<div slot="${slotName}" slot-props="${props.join(', ')}" hidden>${transformed}</div>`
|
|
168
169
|
}
|
|
169
170
|
)
|
|
170
171
|
}
|
package/package.json
CHANGED