PassThrough (pt) is an API that allows developers to access and manipulate the internal DOM structure of a component. By using the :pt prop, you can apply arbitrary attributes, styles (via className), and listeners directly to specific internal elements of a component (like icons, labels, or loading indicators). This bypasses the limitations of the component's primary public API and provides deep customization capabilities.
Example of customizing a cl-button internal elements:
<cl-button
:pt="{
className: '!rounded-2xl',
icon: {
size: 50,
className: 'mr-5',
},
label: {
color: 'red',
className: 'font-bold',
},
loading: {
size: 50,
},
}"
>
点击
</cl-button>