From cc238cdb8e9e90b700c22dfb0530d395e60c9836 Mon Sep 17 00:00:00 2001 From: Anthony Catel Date: Thu, 14 Apr 2022 04:03:17 +0200 Subject: [PATCH] fix(ssr): avoid rendering reserved internal keys in output (#5564) fix #5563 --- packages/server-renderer/__tests__/ssrRenderAttrs.spec.ts | 2 ++ packages/server-renderer/src/helpers/ssrRenderAttrs.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server-renderer/__tests__/ssrRenderAttrs.spec.ts b/packages/server-renderer/__tests__/ssrRenderAttrs.spec.ts index f3bcf8d3..62ccdb59 100644 --- a/packages/server-renderer/__tests__/ssrRenderAttrs.spec.ts +++ b/packages/server-renderer/__tests__/ssrRenderAttrs.spec.ts @@ -15,6 +15,8 @@ describe('ssr: renderAttrs', () => { expect( ssrRenderAttrs({ key: 1, + ref_key: 'foo', + ref_for: 'bar', ref: () => {}, onClick: () => {} }) diff --git a/packages/server-renderer/src/helpers/ssrRenderAttrs.ts b/packages/server-renderer/src/helpers/ssrRenderAttrs.ts index 8814f1fd..147d08f0 100644 --- a/packages/server-renderer/src/helpers/ssrRenderAttrs.ts +++ b/packages/server-renderer/src/helpers/ssrRenderAttrs.ts @@ -12,7 +12,7 @@ import { } from '@vue/shared' // leading comma for empty string "" -const shouldIgnoreProp = makeMap(`,key,ref,innerHTML,textContent`) +const shouldIgnoreProp = makeMap(`,key,ref,innerHTML,textContent,ref_key,ref_for`) export function ssrRenderAttrs( props: Record,