ElemeFE / ElemeFE/element

[Feature Request] It is recommended to add and open a function that can call the selected effect independently to the component (equivalent to re-executing the logic of the selected effect)

Open
#21,725 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

### Existing Component

### Component Name
Select

### Description
Using this component assumes that I have roughly 1000 pieces of data, or it may be more or not. At this time, I will display the drop-down list in the form of list.slice(page,pageSize) and then customize it with vue. way to add a scroll loading function every time page is scrolled to achieve the effect of paging display. But there will be a problem. Suppose that the value / v-model binding value I bind does not exist on the first page of the list data. At this time, the label copy of the component mapping is wrong. Of course, the problem I have solved is During initialization, the option value (value) is changed to the text field name in the data (and at the same time, the content of the field name bound to the component is set to the text field value in the list data) instead of the unique id field name in the data like this It can be mapped normally during initialization; but when scrolling to the second page, I will dynamically determine whether the current value / v-model binding value appears in the current list data of the drop-down list. If it appears, the option value ( value) to the unique id field name in the data. At this time, the component does not seem to execute the normal selection logic to map the corresponding label copy. Finally, after observing for a long time, I found that there is a setSelected function inside the Select component, but it has not been opened. I am My current problem is solved by actively calling a function inside the component via this.$refs.mod.setSelected() (the way in Vue). If it can be suggested to be open for users to call independently, this is the same as the doLayout function. In some rare cases, the normal rendering of components is guaranteed;

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.