Bladeren bron

chore: fix codegen error due to scopeId deprecation change

Evan You 4 jaren geleden
bovenliggende
commit
317654b34f

+ 4 - 4
packages/compiler-core/__tests__/__snapshots__/scopeId.spec.ts.snap

@@ -14,7 +14,7 @@ export function render(_ctx, _cache) {
     _createTextVNode(_toDisplayString(_ctx.foo), 1 /* TEXT */),
     _hoisted_2
   ]))
-})"
+}"
 `;
 
 exports[`scopeId compiler support should wrap default slot 1`] = `
@@ -29,7 +29,7 @@ export function render(_ctx, _cache) {
     ]),
     _: 1 /* STABLE */
   }))
-})"
+}"
 `;
 
 exports[`scopeId compiler support should wrap dynamic slots 1`] = `
@@ -56,7 +56,7 @@ export function render(_ctx, _cache) {
       }
     })
   ]), 1024 /* DYNAMIC_SLOTS */))
-})"
+}"
 `;
 
 exports[`scopeId compiler support should wrap named slots 1`] = `
@@ -74,5 +74,5 @@ export function render(_ctx, _cache) {
     ]),
     _: 1 /* STABLE */
   }))
-})"
+}"
 `;

+ 0 - 4
packages/compiler-core/src/codegen.ts

@@ -304,10 +304,6 @@ export function generate(
   deindent()
   push(`}`)
 
-  if (genScopeId && !isSetupInlined) {
-    push(`)`)
-  }
-
   return {
     ast,
     code: context.code,

+ 4 - 4
packages/compiler-ssr/__tests__/ssrScopeId.spec.ts

@@ -15,7 +15,7 @@ describe('ssr: scopeId', () => {
 
       export function ssrRender(_ctx, _push, _parent, _attrs) {
         _push(\`<div\${_ssrRenderAttrs(_attrs)} data-v-xxxxxxx><span data-v-xxxxxxx>hello</span></div>\`)
-      })"
+      }"
     `)
   })
 
@@ -45,7 +45,7 @@ describe('ssr: scopeId', () => {
           }),
           _: 1 /* STABLE */
         }, _parent))
-      })"
+      }"
     `)
   })
 
@@ -74,7 +74,7 @@ describe('ssr: scopeId', () => {
           }),
           _: 1 /* STABLE */
         }, _parent))
-      })"
+      }"
     `)
   })
 
@@ -122,7 +122,7 @@ describe('ssr: scopeId', () => {
           }),
           _: 1 /* STABLE */
         }, _parent))
-      })"
+      }"
     `)
   })
 })