svelte-autokana
v0.3.0
Published
Svelte action to automatically fill in the kana field
Readme
svelte-autokana
ふりがなを自動で入力するためのSvelte Attachment
Installation
npm i svelte-autokanapnpm add svelte-autokanaUsage
<script lang="ts">
import { createAutoKana } from 'svelte-autokana'
const [nameKanji, nameKana] = createAutoKana()
</script>
<label for="name">名前</label>
<input id="nameKanji" type="text" {@attach nameKanji} />
<label for="nameKana">名前(かな)</label>
<input id="nameKana" type="text" {@attach nameKana} />Parameters
| Name | Type | Default value | Description |
| -------------- | :-------: | :-----------: | ------------------------------------------- |
| katakana | boolean | false | trueの場合、出力はカタカナ |
| clearWhenEmpty | boolean | true | 元のinputを空にしたときに、かなも空にするか |
