跳到正文

RTL

@vuepress/plugin-rtl

此插件在配置的语言上设置文本方向为 RTL。

使用方法

npm i -D @vuepress/plugin-rtl@next
.vuepress/config.ts
import { rtlPlugin } from '@vuepress/plugin-rtl'

export default {
  plugins: [
    rtlPlugin({
      // 配置项
      locales: ['/ar/'],
    }),
  ],
}

示例

选项

localesstring[]
默认值['/']

启用 RTL 布局的语言路径。

selectorSelectorOptions
默认值{ 'html': { dir: 'rtl' } }

启用 RTL 布局的选择器配置。默认设置意味着在 RTL 语言中,html 元素的 dir 属性将被设置为 rtl。

其类型为:

interface SelectorOptions {
  [cssSelector: string]: {
    [attr: string]: string
  }
}

MIT 协议