bootstrap-vue-3
Version:
Early (but lovely) implementation of Vue 3, Bootstrap 5 and Typescript
13 lines (10 loc) • 371 B
text/typescript
import type {Directive, DirectiveBinding} from 'vue'
const setTheme = (el: HTMLElement, value: string): void => el.setAttribute('data-bs-theme', value)
export default {
mounted(el, binding: DirectiveBinding): void {
setTheme(el, binding.value)
},
updated(el, binding: DirectiveBinding): void {
setTheme(el, binding.value)
},
} as Directive<HTMLElement>