Subscribe on changes!

How directive in Vue 3 Works

avatar
Jan 7th 2022

What problem does this feature solve?

cant understand how vue directives works in VUE 3 . It has 4 weeks that I am trying a solution for that .

I didn't found a documentation about that . A SPA DIRECTIVE IS LIKE THAT -

  app.directive('color', {
    mounted (el, binding) {
      el.style.color = 'purple'
    }
  })

HOW COULD I DO IT IN SSR ? -

export default (dir) => {
  return {
    props: []
  }
}

I don't understand how can I access this props

It looks like does not has this feature for SSR -

https://github.com/vuejs/vitepress/issues/92#issuecomment-739115781

What does the proposed API look like?

I need Directive to click outside in a component in VUE 3 + SSR mode . it only works on SPA mode .

avatar
Jan 7th 2022

This is a missing piece in the docs, but not an issue for this repository. We will make sure to cover it in the upcoming new docs.

avatar
Jan 10th 2022

thanks @LinusBorg