From 74829ca2fc83c923e4be83544e809bf915c7cd67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Wed, 30 Aug 2023 15:29:52 +0800 Subject: [PATCH] test: add non-inline --- .../__tests__/transforms/transformElement.spec.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/compiler-core/__tests__/transforms/transformElement.spec.ts b/packages/compiler-core/__tests__/transforms/transformElement.spec.ts index 7cb1f851059..ae891a47cc9 100644 --- a/packages/compiler-core/__tests__/transforms/transformElement.spec.ts +++ b/packages/compiler-core/__tests__/transforms/transformElement.spec.ts @@ -163,6 +163,17 @@ describe('compiler: element transform', () => { expect(node.tag).toBe(`_unref(props["Foo"]).Example`) }) + test('resolve namespaced component from props bindings (non-inline)', () => { + const { root, node } = parseWithElementTransform(``, { + inline: false, + bindingMetadata: { + Foo: BindingTypes.PROPS + } + }) + expect(root.helpers).not.toContain(RESOLVE_COMPONENT) + expect(node.tag).toBe('$props["Foo"].Example') + }) + test('do not resolve component from non-script-setup bindings', () => { const bindingMetadata = { Example: BindingTypes.SETUP_MAYBE_REF