This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/components/SimplePronounList.vue

34 lines
1.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<ul>
<li v-for="pronoun in pronouns" :key="pronoun.canonicalName">
<nuxt-link v-if="typeof pronoun === 'string'" :to="'/' + pronoun">
<strong>{{pronoun.replace(/&/g, ' ' + $t('pronouns.or') + ' ')}}</strong>
</nuxt-link>
<nuxt-link v-else :to="addSlash('/' + pronoun.canonicalName)">
<strong>{{pronoun.name(glue)}}</strong><small v-if="pronoun.smallForm">/{{pronoun.morphemes[pronoun.smallForm]}}</small>
<small>{{pronoun.description}}</small>
</nuxt-link>
<NormativeBadge v-if="pronoun.normative"/>
</li>
</ul>
</template>
<script>
export default {
props: {
pronouns: {},
},
data() {
return {
glue: ' ' + this.$t('pronouns.or') + ' ',
}
},
methods: {
addSlash(link) {
return link + (link.substr(link.length - 1) === '*' ? '/' : '');
},
}
}
</script>