How to load (installed) components in Vue Composition API
P粉010967136
P粉010967136 2023-08-28 14:53:31
0
1
469
<p>I'm trying to load <code>vue3-burger-menu</code>, but the documentation is only for the <code>Options API</code>. On the other hand, I'm using the <code>Composition API</code>, but I'm a bit stuck. </p> <p>The documentation says this:</p> <pre class="brush:php;toolbar:false;">import { Slide } from 'vue3-burger-menu' // import the CSS transitions you wish to use, in this case we are using `Slide` export default { components: { Slide // Register your component } }</pre> <p>But <code>export defaults</code> doesn't work for me. </p> <p>So, how do I load <code>slideshows</code>? </p>
P粉010967136
P粉010967136

reply all(1)
P粉151466081

Here is a working playground with vue3-burger-menu example.

https://stackblitz.com/edit/vue-wwkpny ?file=src/App.vue

You must put the code in the question into a custom component.

like this:

MyMenu.vue

<template>
    <Slide>
      <a id="home" href="#">
        <span>Home</span>
      </a>
    </Slide>
</template>

<script>
import { Slide } from 'vue3-burger-menu'  // import the CSS transitions you wish to use, in this case we are using `Slide`

export default {
    components: {
        Slide // Register your component
    }
}
</script>

and use it in your application:

App.vue

<template>
  <div id="app">
    <MyMenu />
  </div>
</template>

<script>
import MyMenu from './components/MyMenu.vue'

export default {
  name: 'App',
  components: {
    MyMenu
  }
}
</script>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template