Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update docs for vue+vite #1195

Merged
merged 4 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/vue3-boilerplate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@telekom/scale-components-neutral": "^3.0.0-beta.16",
"@telekom/scale-components-neutral": "^3.0.0-beta.110",
"core-js": "^3.6.5",
"vue": "^3.0.0"
},
Expand Down
9 changes: 9 additions & 0 deletions examples/vue3-vite-boilerplate/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<template>
<main>
<div>
<h1 class="scl-font-variant-heading-1">Scale + Vue3 + Vite </h1>
<scale-button
Expand All @@ -8,6 +9,7 @@
Open the docs
</scale-button>
</div>
</main>
</template>

<style>
Expand All @@ -23,4 +25,11 @@
filter: drop-shadow(0 0 2em #42b883aa);
}

main {
display: grid;
place-items: center;
height: 100vh;
font-family: sans-serif;
}

</style>
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import { defineCustomElements } from "@telekom/scale-components/loader";
defineCustomElements(window);
```

> As of July 2021, modern build tools like Vite or Snowpack will break with this lazy-loading mechanism ([see GitHub issue in Stencil's repo](https://github.com/ionic-team/stencil/issues/2827)). To work around this issue, please load the library via `link` and `script` tags as in the "Plain HTML" snippet above.

### NPM Packages

| Package Name | Description |
Expand Down
13 changes: 13 additions & 0 deletions packages/storybook-vue/stories/setup_and_info/ScaleAndVue_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ rules: [
// ...
];

// in vite.config.js
defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('scale-'),
},
},
}),
],
});

// or in main.js (on-the-fly template compilation)
const app = Vue.createApp({});
app.config.compilerOptions.isCustomElement = (tag) => tag.startsWith('scale-');
Expand Down
13 changes: 13 additions & 0 deletions packages/storybook-vue/stories/setup_and_info/ScaleAndVue_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ rules: [
// ...
];

// in vite.config.js
defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('scale-'),
},
},
}),
],
});

// or in main.js (on-the-fly template compilation)
const app = Vue.createApp({});
app.config.compilerOptions.isCustomElement = (tag) => tag.startsWith('scale-');
Expand Down