A custom directive similar to v-if in vuejs

Try to use this hack: Vue.directive(‘permission’, (el, binding, vnode) => { if (!isUserGranted(binding.value)) { // replace HTMLElement with comment node const comment = document.createComment(‘ ‘); Object.defineProperty(comment, ‘setAttribute’, { value: () => undefined, }); vnode.elm = comment; vnode.text=” “; vnode.isComment = true; vnode.context = undefined; vnode.tag = undefined; vnode.data.directives = undefined; if (vnode.componentInstance) { vnode.componentInstance.$el = … Read more

Difference between v-model and v-bind on Vue.js?

From here – Remember: <input v-model=”something”> is essentially the same as: <input v-bind:value=”something” v-on:input=”something = $event.target.value” > or (shorthand syntax): <input :value=”something” @input=”something = $event.target.value” > So v-model is a two-way binding for form inputs. It combines v-bind, which brings a js value into the markup and v-on:input to update the js value. The js … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)