Skip to content

Commit

Permalink
add using ES Modules
Browse files Browse the repository at this point in the history
using the `importmap` syntax
  • Loading branch information
kingma-sbw authored Nov 2, 2024
1 parent 0e8b92b commit ab56666
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions packages/docs/src/pages/en/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,39 @@ const app = createApp()
app.use(vuetify).mount('#app')
```

## Using ES Modules
Use the same links as above but put them in an import map

```js
<script type="importmap">
{
"imports": {
"vue": "https://unpkg.com/vuelatest/dist/vue.esm-browser.js",
"vuetify": "https://unpkg.com/[email protected]/dist/vuetify.esm.js"
}
}
</script>
```

and than import from `vuetify` (and `vue`) with

```js
<script type="module">
const apiUrl = 'http://zeugnis-admin.localhost/'
import { createApp } from 'vue'
import { createVuetify } from 'vuetify'

const vuetify = createVuetify()
createApp().use(vuetify).mount('#app')
</script>
```

and make sure to link the css

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css">
```

## Using Vitepress

You can use Vuetify's components in your Vitepress static site.
Expand Down

0 comments on commit ab56666

Please sign in to comment.