Skip to content

Commit a603d56

Browse files
committed
wip: make <script setup> closed by default
1 parent 468e0d9 commit a603d56

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/compiler-sfc/src/compileScript.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -816,13 +816,14 @@ export function compileScript(
816816
s.appendRight(endOffset, `\nreturn ${returned}\n}\n\n`)
817817

818818
// 11. finalize default export
819-
let runtimeOptions = ``
819+
// expose: [] makes <script setup> components "closed" by default.
820+
let runtimeOptions = `\n expose: [],`
820821
if (optionsArg) {
821-
runtimeOptions = `\n ${scriptSetup.content
822+
runtimeOptions += `\n ${scriptSetup.content
822823
.slice(optionsArg.start! + 1, optionsArg.end! - 1)
823824
.trim()},`
824825
} else if (optionsType) {
825-
runtimeOptions =
826+
runtimeOptions +=
826827
genRuntimeProps(typeDeclaredProps) + genRuntimeEmits(typeDeclaredEmits)
827828
}
828829
if (isTS) {

0 commit comments

Comments
 (0)