zollero / el-search-table-pagination

🐶 Combine Form, Table and Pagination components of Element UI together.
MIT License
305 stars 79 forks source link

Set search form values #67

Open RealAtix opened 3 years ago

RealAtix commented 3 years ago

Is it possible to set the values of the search form items?

I implemented a caching mechanism; if the user goes back to the table from another route, he will see the same search result. My issue is that I haven't found any way to set the form values (of input, select, daterange) from cache by code.

I tried scanning this.$refs.myTable.$refs.searchForm for a way but couldn't find the right place and make it work.

Tony-xubiao commented 2 years ago

I met that situation either, Did you got any solutions for it?

RealAtix commented 2 years ago

@Tony-xubiao I haven't found a better way than doing something like this... It doesn't work for every input type. this.$refs[this.tableRef].$refs.searchForm.$refs.form.$children[0].$children[1].$refs.reference.handleInput({ target: { value: searchParams.day }})