Files
newfreeplanet_OLD/src/components/CTitlePage/CTitlePage.ts

52 lines
1013 B
TypeScript
Raw Normal View History

import { computed, defineComponent, onMounted, PropType, ref } from 'vue'
import { costanti } from '@costanti'
export default defineComponent({
name: 'CTitlePage',
props: {
ind: {
type: Number,
required: false,
default: -1,
},
title: {
type: String,
required: false
},
icon: {
type: String,
required: false
},
color: {
type: String,
required: false
},
},
setup(props) {
const mytitle = ref('')
const myicon = ref('')
const mycolor = ref('')
function mount() {
if (props.ind === -1) {
mytitle.value = props.title!
myicon.value = props.icon!
mycolor.value = props.color!
} else {
mytitle.value = costanti.MAINCARDS[props.ind].title
myicon.value = costanti.MAINCARDS[props.ind].icon
mycolor.value = costanti.MAINCARDS[props.ind].color
}
}
onMounted(mount)
return {
mytitle,
myicon,
mycolor,
}
},
})