-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f75086
commit 9dae425
Showing
5 changed files
with
80 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { createApp } from 'vue' | ||
import '@unocss/reset/tailwind.css' | ||
import '@vue/repl/style.css' | ||
import './vars.scss' | ||
import App from './App.vue' | ||
import { createApp } from 'vue'; | ||
import '@unocss/reset/tailwind.css'; | ||
import '@vue/repl/style.css'; | ||
import './vars.scss'; | ||
import App from './App.vue'; | ||
|
||
createApp(App).mount('#app') | ||
createApp(App).mount('#app'); |
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,23 +1,23 @@ | ||
import { getCurrentInstance } from 'vue' | ||
import Vant from 'vant' | ||
import { getCurrentInstance } from 'vue'; | ||
import Vant from 'vant'; | ||
|
||
let installed = false | ||
await loadStyle() | ||
let installed = false; | ||
await loadStyle(); | ||
|
||
export function setupVant() { | ||
if (installed) return | ||
const instance = getCurrentInstance() | ||
instance.appContext.app.use(Vant) | ||
installed = true | ||
if (installed) return; | ||
const instance = getCurrentInstance(); | ||
instance.appContext.app.use(Vant); | ||
installed = true; | ||
} | ||
|
||
function loadStyle() { | ||
return new Promise((resolve, reject) => { | ||
const link = document.createElement('link') | ||
link.rel = 'stylesheet' | ||
link.href = '#STYLE#' | ||
link.addEventListener('load', resolve) | ||
link.addEventListener('error', reject) | ||
document.body.append(link) | ||
}) | ||
const link = document.createElement('link'); | ||
link.rel = 'stylesheet'; | ||
link.href = '#STYLE#'; | ||
link.addEventListener('load', resolve); | ||
link.addEventListener('error', reject); | ||
document.body.append(link); | ||
}); | ||
} |
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