feat(compiler-sfc): <script setup> defineProps destructure transform (#4690)

This commit is contained in:
Evan You
2021-09-27 14:24:21 -04:00
committed by GitHub
parent d84d5ecdbd
commit 467e113b95
14 changed files with 717 additions and 124 deletions

View File

@@ -64,7 +64,9 @@ const {
// @babel/parser plugins to enable.
// 'typescript' and 'jsx' will be auto-inferred from filename if provided,
// so in most cases explicit parserPlugins are not necessary
parserPlugins: [/* ... */]
parserPlugins: [
/* ... */
]
})
```
@@ -93,7 +95,7 @@ const ast = parse(src, { sourceType: 'module' })
const s = new MagicString(src)
const {
rootVars, // ['a']
rootRefs, // ['a']
importedHelpers // ['ref']
} = transformAST(ast, s)