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

26 lines
568 B
Vue
Raw Normal View History

2020-09-28 05:14:00 -07:00
<template>
<component :is="Array.isArray(txt) ? 'div' : 'span'">
<template v-if="Array.isArray(txt)">
<p v-for="p in txt">
<LinkedText :text="p"/>
</p>
</template>
<LinkedText v-else :text="txt"/>
</component>
</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: {},
},
2020-09-28 05:14:00 -07:00
data() {
return {
2020-10-14 12:46:39 -07:00
txt: t(this.$slots.default[0].text, this.params || {}),
2020-09-28 05:14:00 -07:00
}
},
}
</script>