fix(Carousel): use dir from locale (#2647)

This commit is contained in:
Malik-Jouda
2024-11-15 13:00:51 +02:00
committed by GitHub
parent 0daac5bafb
commit 1fbbfe8df0
2 changed files with 3 additions and 4 deletions

View File

@@ -149,8 +149,7 @@ const options = computed<EmblaOptionsType>(() => ({
...(props.fade ? { align: 'center', containScroll: false } : {}),
...rootProps.value,
axis: props.orientation === 'horizontal' ? 'x' : 'y',
// TODO: Get from ConfigProvider
direction: 'ltr'
direction: dir.value === 'rtl' ? 'rtl' : 'ltr'
}))
const plugins = computedAsync<EmblaPluginType[]>(async () => {

View File

@@ -18,8 +18,8 @@ export default (options: Required<ModuleOptions>) => ({
vertical: {
container: 'flex-col -mt-4',
item: 'pt-4',
prev: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
next: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90'
prev: '-top-12 left-1/2 -translate-x-1/2 rotate-90 rtl:-rotate-90',
next: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90 rtl:-rotate-90'
},
horizontal: {
container: 'flex-row -ms-4',