hjl19911127 / vue-drawer-layout

A simple DrawerLayout component for Vue.js.
http://share.codehuang.com/vue-drawer-layout
MIT License
408 stars 86 forks source link

Can't get it working with nuxt #28

Closed regenrek closed 1 year ago

regenrek commented 5 years ago

Hey

thanks for this cool plugin. Do you have a example on how to use this with nuxt please?

Thanks in advance!

PaulHarrer commented 4 years ago

@regenrek Unfortunately it does currently not support SSR, so you can use it with nuxt but only with client side rendering, or you would have to rewrite it to support SSR (should not be that much work).

For that you have to create a plugin and add it to the nuxt.config.js with the client parameter. For example you can do something like (of course you first have to install the npm package ;) ):

plugins/vue-drawer-layout.js

import Vue from 'vue'
import DrawerLayout from 'vue-drawer-layout'

Vue.use(DrawerLayout)

nuxt.config.js

...
plugins: [
    { src: '~/plugins/vue-drawer-layout', mode: 'client' },
  ],
...