# Button List Bone

# Introducción

Éste componente no está encargado de renderizar, es de uso interno del IrButtonList. Guía de uso parte lógica

# Código fuente

<script>
const propsLocal = {
  buttons: {
    type: Array,
    default: () => []
  },
  title: {
    type: String,
    default: ''
  }
}
import {
  normalizeProps,
  assignCamelToSnake
} from '../../helpers/propsGenerator'
import Vue from 'vue'
import { ref, h, onMounted } from 'vue'
const mergedProps = normalizeProps(propsLocal)
import { buttonListComponentName } from '../../constants'
export default {
  name: buttonListComponentName + 'Bone',
  props: mergedProps,
  setup(props, { slots }) {
    const propError = Vue.prototype.$propError
    const iclstore = Vue.prototype.$iclstore
    const structureError = ref(false)
    assignCamelToSnake(mergedProps, props)
    onMounted(() => {
      structureError.value = propError(
        propsLocal,
        props,
        buttonListComponentName
      )
      if (structureError.value) {
        iclstore.commit('updateSnack', {
          text: 'Ha ocurrido un error al cargar la lista de botones',
          active: true,
          color: 'warning'
        })
      }
    })
    return () => {
      if (structureError.value) {
        return
      }
      return h(
        'div', // Contenedor como nodo raíz
        [
          slots.default({
            buttons: props.buttons,
            title: props.title
          })
        ]
      )
    }
  }
}
</script>
Last Updated: 5/31/2024, 4:32:29 PM