Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and astrobot-houston committed Mar 31, 2023
1 parent d59e511 commit 7f8ccbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions packages/astro/e2e/vue-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ test.describe('Vue components in MDX files', () => {
});
});


test('test the async vue component in astro', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/'));
await page.goto(astro.resolveUrl('/'));

const label = page.locator('#client-test');
const label = page.locator('#client-test');

await expect(label, 'component not hydrated').toHaveText('2');
await expect(label, 'component not hydrated').toHaveText('2');
});

test('test the async vue component in mdx', async ({ page, astro }) => {
Expand Down
8 changes: 4 additions & 4 deletions packages/integrations/vue/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export default (element) =>
// related to https://github.com/withastro/astro/issues/6549
// if the component is async, wrap it in a Suspense component
if (isAsync(Component.setup)) {
content = h(Suspense, null, content)
content = h(Suspense, null, content);
}

if (client === 'only') {
const app = createApp({ name, render: () => content });
await setup(app);
Expand All @@ -32,7 +32,7 @@ export default (element) =>
}
};

function isAsync (fn) {
const constructor = fn?.constructor
function isAsync(fn) {
const constructor = fn?.constructor;
return constructor && constructor.name === 'AsyncFunction';
}

0 comments on commit 7f8ccbe

Please sign in to comment.