primevue-mirror/components/lib/chip/BaseChip.vue

81 lines
1.4 KiB
Vue

<script>
import BaseComponent from 'primevue/basecomponent';
import { useStyle } from 'primevue/usestyle';
const styles = `
@layer primevue {
.p-chip {
display: inline-flex;
align-items: center;
}
.p-chip-text {
line-height: 1.5;
}
.p-chip-icon.pi {
line-height: 1.5;
}
.p-chip-remove-icon {
line-height: 1.5;
cursor: pointer;
}
.p-chip img {
border-radius: 50%;
}
}
`;
const classes = {
root: ({ props }) => [
'p-chip p-component',
{
'p-chip-image': props.image != null
}
],
icon: 'p-chip-icon',
label: 'p-chip-text',
removeIcon: 'p-chip-remove-icon'
};
const { load: loadStyle } = useStyle(styles, { name: 'chip', manual: true });
export default {
name: 'BaseChip',
extends: BaseComponent,
props: {
label: {
type: String,
default: null
},
icon: {
type: String,
default: null
},
image: {
type: String,
default: null
},
removable: {
type: Boolean,
default: false
},
removeIcon: {
type: String,
default: undefined
}
},
css: {
classes,
loadStyle
},
provide() {
return {
$parentInstance: this
};
}
};
</script>