-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: remove vue plugin from preload playground (#11451)
- Loading branch information
1 parent
8196a5f
commit 54e4df5
Showing
18 changed files
with
64 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
<div id="app"></div> | ||
<h1>preload</h1> | ||
<div id="hello"> | ||
<button class="load">Load hello</button> | ||
<div class="msg"></div> | ||
</div> | ||
<div id="about"> | ||
<button class="load">Load about</button> | ||
<div class="msg"></div> | ||
</div> | ||
|
||
<script type="module"> | ||
import { createApp } from 'vue' | ||
import router from './router.js' | ||
import App from './src/App.vue' | ||
import { msgFromA } from '@vitejs/test-dep-a' | ||
console.log(msgFromA) | ||
|
||
createApp(App).use(router).mount('#app') | ||
import './src/main.js' | ||
document | ||
.querySelector('h1') | ||
.insertAdjacentHTML('afterEnd', '<div id="done">ran js</div>') | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { msg } from '@vitejs/test-dep-including-a' | ||
|
||
document.querySelector('#about .msg').textContent = msg |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import style from './hello.module.css' | ||
|
||
const msg = document.querySelector('#hello .msg') | ||
msg.textContent = 'hello' | ||
msg.classList.add(style.h1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.h1 { | ||
color: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const ids = { | ||
hello: async () => { | ||
await import(/* a comment */ './hello.js') | ||
}, | ||
about: async () => { | ||
await import('./about.js') // lazy load | ||
}, | ||
} | ||
|
||
for (const [id, loader] of Object.entries(ids)) { | ||
const loadButton = document.querySelector(`#${id} .load`) | ||
loadButton.addEventListener('click', async () => { | ||
await loader() | ||
loadButton.insertAdjacentHTML('afterend', '<output>loaded</output>') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.