1.1.0 • Published 2 years ago

@wiwo/widget-vue2 v1.1.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

@wiwo/widget-vue2

This embeds a Widget Works Widget inside a Vue 2 component or NuxtJS v2.x site.


Installation

Add @wiwo/widget-vue2 to your package.json:

npm install --save @wiwo/widget-vue2

then follow the examples below to use in your project.


Example: Vue 2

<script>
import { WiwoWidget } from '@wiwo/widget-vue2'

export default Vue.extend({
  components: {
    WiwoWidget,
  },
});
</script>

<template>
  <div>
    <WiwoWidget licenseId="yourLicenseId" />
  </div>
</template>

Example: NuxtJS 2

Register the library with Nuxt:

// nuxt.config.js

buildModules: [
  // Use components as Nuxt module
  '@wiwo/widget-vue2/nuxt',
]

Render the components in your site:

(The required licenseId will be provided to you separately)

// /pages/examplepage.vue

<template>
  <div>
    <WiwoWidget licenseId="yourLicenseId"/>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'

export default Vue.extend({
  name: 'ExamplePage',
})
</script>