This package has been deprecated

Author message:

Please use @telekom/scale-components directly, see the Scale docs. Vue support for web components is already great.

@telekom/scale-components-vue
TypeScript icon, indicating that this package has built-in type declarations

3.0.0-beta.56 • Public • Published

Scale and Vue

Vue works well with custom elements, but has some minor limitations.

To work around this problems we provide custom element wrappers for better developer experience.

Please note that you will need to install both, the @telekom/scale-components as well as the @telekom/scale-components-vue packages.

Once you have installed both packages and defined the custom elements, Scale components behave mostly the way you would expect a Vue component to behave!

src/main.ts

import Vue from "vue";
import App from "./App.vue";
import { applyPolyfills, defineCustomElements } from "@telekom/scale-components/loader";
import "@telekom/scale-components/dist/scale-components/scale-components.css";

Vue.config.productionTip = false;
Vue.config.ignoredElements = [/scale-\w*/];

applyPolyfills().then(() => {
  defineCustomElements(window);
});

new Vue({
  render: h => h(App)
}).$mount("#app");

src/App.vue

<template>
  <div>
    <scale-button>Click!</scale-button>
  </div>
</template>

<script>
import Vue from 'vue'
import { ScaleButton } from "@telekom/scale-components-vue";

export default Vue.extend({
  name: "app",
  components: { ScaleButton },
});
</script>

Events in Vue

In order to prevent collisions with standard events and compatibility with other libraries and frameworks, some components of Scale are using custom event names. You can find documentation for the custom events on the respective component pages in the docs section.

Events in Vue are prefixed with: scale-{event-name}


Find Telekom Scale on GitHub.

Readme

Keywords

none

Package Sidebar

Install

npm i @telekom/scale-components-vue

Weekly Downloads

151

Version

3.0.0-beta.56

License

MPL-2.0

Unpacked Size

285 kB

Total Files

13

Last publish

Collaborators

  • acstll
  • mzhang