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

Commit

Permalink
fix: should provide scope id to template compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 24, 2020
1 parent 4e045b7 commit 2c0459c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ export default function PluginVue(userOptions: Partial<Options> = {}): Plugin {
source: code,
preprocessLang: block.lang,
compiler: options.compiler,
compilerOptions: options.compilerOptions,
compilerOptions: {
...options.compilerOptions,
scopeId: `data-v-${query.id}`,
},
transformAssetUrls: options.transformAssetUrls,
})

Expand Down Expand Up @@ -232,7 +235,13 @@ type Query =
| {
filename: string
vue: true
type: 'script' | 'template'
type: 'script'
}
| {
filename: string
vue: true
type: 'template'
id?: string
}
| {
filename: string
Expand Down

0 comments on commit 2c0459c

Please sign in to comment.