File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<template >
22 <div class =" inline-flex rounded-md shadow-xs" role =" group" >
3- <button v-for =" button in buttons" :key =" `${button}-button-controll`"
4- class =" inline-flex items-center text-sm font-medium border-t border-b border-r border-lightButtonGroupBorder focus:z-10 focus:ring-2 dark:border-darkButtonGroupBorder"
3+ <button v-for =" button in buttons" :key =" `${button}-button-controll`" :disabled = " slotProps[button]?.disabled "
4+ class =" inline-flex items-center text-sm font-medium border-t border-b border-r border-lightButtonGroupBorder focus:z-10 focus:ring-2 dark:border-darkButtonGroupBorder disabled:opacity-50 disabled:cursor-not-allowed "
55 :class =" [
66 buttonsStyles[button] === 'rounded' ? 'border rounded-lg'
77 : buttonsStyles[button] === 'rounded-left' ? 'border rounded-s-lg'
2424 const buttons : Ref <string []> = ref ([]);
2525 const buttonsStyles : Ref <Record <string , string >> = ref ({});
2626 const activeButton = ref (' ' );
27+ const slotProps: Record <string , any > = ref ({});
2728
2829 const emits = defineEmits ([
2930 ' update:activeButton' ,
4950 [button ]: getButtonsClasses (button )
5051 }
5152 buttonsStyles .value = { ... buttonsStyles .value , ... temp };
53+ const slot = slots [` button:${button } ` ];
54+ if (slot && slot ()[0 ]?.props ) {
55+ slotProps [button ] = slot ()[0 ].props ;
56+ } else {
57+ slotProps [button ] = {};
58+ }
5259 }
5360 });
5461
You can’t perform that action at this time.
0 commit comments