Skip to content

Instantly share code, notes, and snippets.

View eserdinyo's full-sized avatar
🏠
Working from home

Muhammet ESER eserdinyo

🏠
Working from home
View GitHub Profile
@eserdinyo
eserdinyo / main.js
Last active September 24, 2018 07:13
import Vue from 'vue'
import App from './App.vue'
Vue.directive('renk', {
bind(el, binding) {
if (binding.arg === 'background') {
el.style.backgroundColor = binding.value;
} else {
el.style.color = binding.value;
}
@eserdinyo
eserdinyo / main.js
Last active September 24, 2018 06:56
import Vue from 'vue'
import App from './App.vue'
Vue.directive('renk', {
bind(el, binding) {
el.style.backgroundColor = 'blue';
}
})
@eserdinyo
eserdinyo / main.js
Last active September 24, 2018 07:11
import Vue from 'vue'
import App from './App.vue'
Vue.directive('renk', {
bind(el, binding) {
el.style.backgroundColor = binding.value;
}
})
import Vue from 'vue'
import App from './App.vue'
Vue.directive('renk', {
bind(el, binding) {
if (binding.arg === 'background') {
el.style.backgroundColor = binding.value;
} else {
el.style.color = binding.value;
}
@eserdinyo
eserdinyo / main.js
Last active September 24, 2018 07:18
import Vue from 'vue'
import App from './App.vue'
Vue.directive('renk', {
bind(el, binding) {
let delay = 0;
if (binding.modifiers['delayed']) {
delay = 3000;
}
Vue.directive('renk', {
bind(el, binding) {
el.style.backgroundColor = binding.value;
}
})
Vue.directive('renk', {
bind(el, binding) {
if (binding.arg === 'background') {
el.style.backgroundColor = binding.value;
} else {
el.style.color = binding.value;
}
}
})
Vue.directive('renk', {
bind(el, binding) {
let delay = 0;
if (binding.modifiers['delayed']) {
delay = 3000;
}
setTimeout(() => {
if (binding.arg === 'background') {
el.style.backgroundColor = binding.value;
@eserdinyo
eserdinyo / App.js
Last active September 24, 2018 07:24
<script>
export default {
data() {
return {};
},
methods: {},
directives: {
"localRenk": {
bind(el, binding, vnode) {
let delay = 0;
<script>
export default {
data() {
return {
counter: 0,
};
},
methods: {
clicked() {
this.counter ++;