Refactor #3965 - For Chip
parent
78954bcc45
commit
5296fc2bd3
|
@ -33,9 +33,9 @@ const classes = {
|
||||||
'p-chip-image': props.image != null
|
'p-chip-image': props.image != null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
icon: ({ props }) => ['p-chip-icon', props.icon],
|
icon: 'p-chip-icon',
|
||||||
label: 'p-chip-text',
|
label: 'p-chip-text',
|
||||||
removeIcon: ({ props }) => ['p-chip-remove-icon', props.removeIcon]
|
removeIcon: 'p-chip-remove-icon'
|
||||||
};
|
};
|
||||||
|
|
||||||
const { load: loadStyle } = useStyle(styles, { id: 'primevue_chip_style', manual: true });
|
const { load: loadStyle } = useStyle(styles, { id: 'primevue_chip_style', manual: true });
|
||||||
|
|
|
@ -3,18 +3,18 @@
|
||||||
<slot>
|
<slot>
|
||||||
<img v-if="image" :src="image" v-bind="ptm('image')" />
|
<img v-if="image" :src="image" v-bind="ptm('image')" />
|
||||||
<component v-else-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" v-bind="ptm('icon')" />
|
<component v-else-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" v-bind="ptm('icon')" />
|
||||||
<span v-else-if="icon" :class="cx('icon')" v-bind="ptm('icon')" />
|
<span v-else-if="icon" :class="[cx('icon'), icon]" v-bind="ptm('icon')" />
|
||||||
<div v-if="label" :class="cx('label')" v-bind="ptm('label')">{{ label }}</div>
|
<div v-if="label" :class="cx('label')" v-bind="ptm('label')">{{ label }}</div>
|
||||||
</slot>
|
</slot>
|
||||||
<slot v-if="removable" name="removeicon" :onClick="close" :onKeydown="onKeydown">
|
<slot v-if="removable" name="removeicon" :onClick="close" :onKeydown="onKeydown">
|
||||||
<component :is="removeIcon ? 'span' : 'TimesCircleIcon'" tabindex="0" :class="cx('removeIcon')" @click="close" @keydown="onKeydown" v-bind="ptm('removeIcon')"></component>
|
<component :is="removeIcon ? 'span' : 'TimesCircleIcon'" tabindex="0" :class="[cx('removeIcon'), removeIcon]" @click="close" @keydown="onKeydown" v-bind="ptm('removeIcon')"></component>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseChip from './BaseChip.vue';
|
|
||||||
import TimesCircleIcon from 'primevue/icons/timescircle';
|
import TimesCircleIcon from 'primevue/icons/timescircle';
|
||||||
|
import BaseChip from './BaseChip.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Chip',
|
name: 'Chip',
|
||||||
|
|
Loading…
Reference in New Issue