mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-26 06:23:35 -04:00
43 lines
1.1 KiB
Vue
43 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|
import type { Pronoun } from '~/src/classes.ts';
|
|
import { loadPronounExamples } from '~/src/data.ts';
|
|
import type { Example } from '~/src/language/examples.ts';
|
|
|
|
const props = withDefaults(defineProps<{
|
|
pronoun: Pronoun;
|
|
morpheme: string;
|
|
counter?: number;
|
|
prepend?: string;
|
|
prependPr?: string;
|
|
append?: string;
|
|
appendPr?: string;
|
|
highlightsMorphemes?: Set<string>;
|
|
}>(), {
|
|
counter: 0,
|
|
prepend: '',
|
|
prependPr: '',
|
|
append: '',
|
|
appendPr: '',
|
|
highlightsMorphemes: (props) => {
|
|
return new Set([props.morpheme]);
|
|
},
|
|
});
|
|
|
|
const pronounExamples = await loadPronounExamples();
|
|
|
|
const examples = computed((): Example[] => {
|
|
return pronounExamples.map((example) => example.example(props.pronoun, props.counter));
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<MorphemeWithPronunciation
|
|
:morpheme
|
|
:example-values="pronoun.toExampleValues(counter)"
|
|
:prefix="{ spelling: prepend, pronunciation: prependPr }"
|
|
:suffix="{ spelling: append, pronunciation: appendPr }"
|
|
:highlights-morphemes
|
|
:examples
|
|
/>
|
|
</template>
|