mirror of
https://github.com/velocitatem/garlic.git
synced 2026-05-31 08:43:36 +00:00
nto working, why.
This commit is contained in:
@@ -3,16 +3,23 @@ import Garlic from './garlic'
|
|||||||
|
|
||||||
// esling gobaly disable no-unused-vars
|
// esling gobaly disable no-unused-vars
|
||||||
|
|
||||||
console.log('Garlic', Garlic)
|
|
||||||
// the intention here is to replace the innerText of the div with itself but encoded with base64
|
// the intention here is to replace the innerText of the div with itself but encoded with base64
|
||||||
// we do this with a custom directive
|
// we do this with a custom directive
|
||||||
Vue.directive('garlic', {
|
Vue.directive('garlic', {
|
||||||
bind(el, binding, vnode, prevVnode) {
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
console.log('inserted', el)
|
beforeMount(el, binding, vnode, prevVnode) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
console.log('beforeCreate', el)
|
||||||
el = Garlic.clove(el)
|
el = Garlic.clove(el)
|
||||||
|
},
|
||||||
|
/*
|
||||||
|
Since most custom directives involve direct DOM manipulation, they are ignored during SSR. However, if you want to specify how a custom directive should be rendered (i.e. what attributes it should add to the rendered element), you can use the getSSRProps directive hook:
|
||||||
|
*/
|
||||||
|
getSSRProps(el) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
console.log('getSSRProps', el)
|
||||||
|
return {
|
||||||
|
innerHTML: Garlic.clove(el)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// what methods can we use here?
|
|
||||||
// methods: inserted, update, componentUpdated, unbind, bind
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user