# Link To Bone
# Introducción
Componente lógico.
# Código fuente
<script>
const props = {
text: {
type: String,
required: false
},
color: {
type: String,
required: false
},
href: {
type: String,
required: false
},
icon: {
type: String,
required: false
},
'icon-size': {
type: [String, Number],
required: false
}
}
import {
normalizeProps,
assignCamelToSnake
} from '../../../helpers/propsGenerator'
import { LinkToComponentName } from '../../../constants'
const mergedProps = normalizeProps(props)
export default {
name: LinkToComponentName + 'Bone',
props: mergedProps,
data() {
return {
}
},
created() {
assignCamelToSnake(mergedProps, this)
},
mounted() {
this.$propError(props, this.$props, LinkToComponentName)
if(!this.text && !this.icon)
console.error(`Error en ${LinkToComponentName}, no se ha enviado la propiedad text, ni icon. El componente no puede renderizarse`)
},
render() {
return this.$scopedSlots.default({
text: this.text,
color: this.color,
href: this.href,
icon: this.icon,
iconSize: this.iconSize
})
}
}
</script>← Componente Componente →