PronounsPage/components/Example.vue
Valentyne Stigloher f0a5c3fffc (ts) migrate
2024-05-13 12:03:20 +02:00

31 lines
1.0 KiB
Vue

<template>
<span>
<span v-for="part in example.parts(pronoun, counter)">
<strong v-if="part.variable"><Morpheme :pronoun="pronoun" :morpheme="part.str" :counter="counter" /></strong>
<span v-else><Spelling :text="part.str" /></span>
</span>
<small v-if="link">
(<nuxt-link :to="`/${pronoun.canonicalName}`"><Spelling escape :text="pronoun.canonicalName" /></nuxt-link>)
</small>
<Pronunciation
v-if="pronunciation && pronoun.pronounceable && example.toPronunciationString(pronoun)"
:pronunciation="example.toPronunciationString(pronoun)"
/>
</span>
</template>
<script lang="ts">
import Vue from 'vue';
import { Example, Pronoun } from '../src/classes.ts';
export default Vue.extend({
props: {
example: { required: true, type: Example },
pronoun: { required: true, type: Pronoun },
counter: { default: 0, type: Number },
link: { type: Boolean },
pronunciation: { type: Boolean },
},
});
</script>