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/T.vue

21 lines
645 B
Vue
Raw Normal View History

2020-09-28 05:14:00 -07:00
<template>
2021-12-02 08:18:25 -08:00
<component :is="Array.isArray(txt) ? 'div' : 'span'"><template v-if="Array.isArray(txt)"><p v-for="p in txt"><Icon v-if="icon" :v="icon"/><LinkedText :text="p"/></p></template><template v-else><Icon v-if="icon" :v="icon"/><LinkedText :text="txt"/></template></component>
2020-09-28 05:14:00 -07:00
</template>
<script>
import t from '../src/translator';
2020-09-28 05:14:00 -07:00
export default {
2020-10-14 12:46:39 -07:00
props: {
params: {},
silent: {type: Boolean},
icon: {},
2020-10-14 12:46:39 -07:00
},
2020-09-28 05:14:00 -07:00
data() {
return {
2021-02-02 09:00:56 -08:00
txt: t(this.$slots.default[0].text, this.params || {}, !this.silent),
2020-09-28 05:14:00 -07:00
}
},
}
</script>