Skip to content

Commit

Permalink
test: ssr-vue example error when routerChanged (#5677)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyuang authored Nov 15, 2021
1 parent bce4e56 commit 2dcb042
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/playground/ssr-vue/__tests__/ssr-vue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ test('client navigation', async () => {
await untilUpdated(() => page.textContent('h1'), 'About')
editFile('src/pages/About.vue', (code) => code.replace('About', 'changed'))
await untilUpdated(() => page.textContent('h1'), 'changed')
await page.click('a[href="/"]')
await untilUpdated(() => page.textContent('a[href="/"]'), 'Home')
})

test('import.meta.url', async () => {
Expand Down
7 changes: 6 additions & 1 deletion packages/playground/ssr-vue/src/pages/About.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<template>
<h1>{{ msg }}</h1>
<p class="import-meta-url">{{ url }}</p>
</template>

<script>
export default {
async setup() {
const url = import.meta.env.SSR
? import.meta.url
: document.querySelector('.import-meta-url').textContent
return {
msg: 'About'
msg: 'About',
url
}
}
}
Expand Down

0 comments on commit 2dcb042

Please sign in to comment.