DocsFrameworks

Vue

Register the directive and pass a text and locale. For existing inline content, use inline: true instead.

Local directive

Import juliyaDirective using Vue's v directive naming convention and bind options to the text element.

vue
<script setup>
import { juliyaDirective as vJuliya } from '@oddmash/juliya/vue';
const text = "Read every line naturally.";
</script>
<template><p v-juliya="{ text, locale: 'en' }"></p></template>

Global registration

Register the directive on the application if shared across components.

ts
import { juliyaDirective } from '@oddmash/juliya/vue';
app.directive('juliya', juliyaDirective);

Required options

Supply text for string mode or inline: true for markup owned by the adapter.

OptionRequiredDefaultPurpose
textConditional-Source for string mode; omit in inline mode
inlineConditionalfalseSet true for existing inline markup
localeOptionalkoLanguage rules; React also reads the nearest Provider
strategyOptionalbalancedBalanced or greedy layout
breakLongWordsOptionaltrueAllow grapheme-safe splits for overlong words
forcedBreaksOptional-Source UTF-16 boundary offsets

Language selection

Pass a locale directly; Korean is the default when omitted.

Inline markup

Avoid Vue-managed dynamic children inside the directive's target. Use the scope directive for rendered HTML.

vue
<p v-juliya="{ inline: true }"><strong>Read every line naturally.</strong></p>

Reactive options

Pass reactive text and options; directive lifecycle updates the controller and unmount cleans it up.

Nuxt and SSR

Server output must remain deterministic. Measure only after mount in the browser.