fix(compiler-sfc): do not resolve assets from setup bindings

when not using script setup

fix #3270, fix #3275
This commit is contained in:
Evan You
2021-03-29 16:11:31 -04:00
parent 4d9f9fdf9d
commit f5827fdf78
5 changed files with 39 additions and 3 deletions

View File

@@ -94,8 +94,10 @@ export const enum BindingTypes {
OPTIONS = 'options'
}
export interface BindingMetadata {
export type BindingMetadata = {
[key: string]: BindingTypes | undefined
} & {
__isScriptSetup?: boolean
}
interface SharedTransformCodegenOptions {

View File

@@ -286,7 +286,7 @@ export function resolveComponentType(
function resolveSetupReference(name: string, context: TransformContext) {
const bindings = context.bindingMetadata
if (!bindings) {
if (!bindings || bindings.__isScriptSetup === false) {
return
}