vue-json-pretty
                                
                                
                                
                                    vue-json-pretty copied to clipboard
                            
                            
                            
                        有搜索功能吗?Is there a search function?
这个组件,有搜索功能吗??
This would be nice to have for large JSON objects.
Hi @leezng is this something you are planning to include? It would be handy for filtering large datasets like @JowJoris mentioned.
I'm very sorry that this issue has not been dealt with. I expect to release a minimum usable method in the next version.
Here, I also hope to collect everyone’s opinions. My initial idea is to search for key and value, and use ref for external calls. If you have any ideas, please reply.
@leezng no need to apologise, it's a great package.
I have a few points to consider:
- It would be useful if it could search nested arrays
 - A strict mode so it can be like or exact
 
@leezng no need to apologise, it's a great package.
I have a few points to consider:
- It would be useful if it could search nested arrays
 - A strict mode so it can be like or exact
 
@JoshuaRobertson strict mode is a good suggestion. Can you provide a specific example for the first point? I'm not sure what effect you want to achieve.
@leezng I think a strict mode for the search would help so you can filter by certain search terms. If we use this example array:
const users = [
  { name: 'John', age: 30, hobbies: ['reading', 'coding'] },
  { name: 'Alice', age: 25, hobbies: ['cooking', 'traveling'] },
  { name: 'Bob', age: 35, hobbies: ['gardening', 'gaming'] }
]
something like:
- Strict: only return array items that exactly match, such as "coding" would return one result (John)
 - Like: return array items that include any of the search, such as "co" would return two results (John & Alice)
 
What do you think?