Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 587 Bytes

index.md

File metadata and controls

35 lines (24 loc) · 587 Bytes
category
Browser

useDir

Reactive dir of the element's text.

Basic Usage

import { useDir } from '@vueuse/core'

const dir = useDir() // Ref<'ltr' | 'rtl' | 'auto'>

By default, which enables rlt direction when dir rtl is applied to the html tag, for example:

<!--ltr-->
<html> ... </html>

<!--rtl-->
<html dir="rtl"> ... </html>

Config

import { useDir } from '@vueuse/core'

const mode = useDir({
  selector: 'body'
}) // Ref<'ltr' | 'rtl' | 'auto'>