Skip to content

Commit

Permalink
update: 优化文本省略组件,新增change事件"
Browse files Browse the repository at this point in the history
  • Loading branch information
ljnMeow committed Aug 23, 2023
1 parent 33d684b commit e199ad3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/nice2cu-ui/src/nEllipsis/Ellipsis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import './style/ellipsis.less';
export default defineComponent({
name: 'NEllipsis',
props: EllipsisProps,
setup(props: EllipsisPropsType) {
emits: ['change'],
setup(props: EllipsisPropsType, { emit }) {
const bem = createNamespace('ellipsis');
const ellipsis = ref<HTMLElement | null>(null);
Expand Down Expand Up @@ -124,8 +125,10 @@ export default defineComponent({
const handlerClick = (type: number) => {
if (type === 1) {
state.expanded = true;
emit('change', 'expand');
} else if (type === 2) {
state.expanded = false;
emit('change', 'collapse');
}
};
Expand Down

0 comments on commit e199ad3

Please sign in to comment.