bootstrap-vue-next
Version:
Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development
20 lines (19 loc) • 740 B
JavaScript
import { b as rtlRegistryKey } from "./keys-CQKrwmvN.mjs";
import { i as getSafeDocument } from "./dom-AhkaSoh8.mjs";
import { inject, onMounted, watch } from "vue";
//#region src/composables/useRtl.ts
var useRtl = () => {
const rtlPlugin = inject(rtlRegistryKey, null);
onMounted(() => {
watch(() => rtlPlugin?.locale.value, (newValue) => {
getSafeDocument()?.documentElement.setAttribute("lang", newValue ?? "");
}, { immediate: true });
watch(() => rtlPlugin?.isRtl.value, (newValue) => {
getSafeDocument()?.documentElement.setAttribute("dir", newValue ?? false ? "rtl" : "ltr");
}, { immediate: true });
});
return { ...rtlPlugin };
};
//#endregion
export { useRtl as t };
//# sourceMappingURL=useRtl-DpwU_RM8.mjs.map