Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 2c0459c

Browse files
committed
fix: should provide scope id to template compilation
1 parent 4e045b7 commit 2c0459c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: src/index.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ export default function PluginVue(userOptions: Partial<Options> = {}): Plugin {
136136
source: code,
137137
preprocessLang: block.lang,
138138
compiler: options.compiler,
139-
compilerOptions: options.compilerOptions,
139+
compilerOptions: {
140+
...options.compilerOptions,
141+
scopeId: `data-v-${query.id}`,
142+
},
140143
transformAssetUrls: options.transformAssetUrls,
141144
})
142145

@@ -232,7 +235,13 @@ type Query =
232235
| {
233236
filename: string
234237
vue: true
235-
type: 'script' | 'template'
238+
type: 'script'
239+
}
240+
| {
241+
filename: string
242+
vue: true
243+
type: 'template'
244+
id?: string
236245
}
237246
| {
238247
filename: string

0 commit comments

Comments
 (0)