There are always a lot of details. If you want a better customer experience, you have to be picky.Copy the code

I have a small problem, how to implement the initial value of the select drop-down menu button is only displayed when the first load, and then still displayed in the drop-down menu is not selected?

The effect here is selectable. If you want it, it can’t be selectable.



To say that the function cannot be selected, the <option< span style = “box-sizing: border-box; color: RGB (51, 51, 51); line-height: 22px; font-size: 14px! Important; word-break: inherit! Important;”

A friend said you can use JS to implement, but not how js broken, and no one to help, so someone idea, nested if statement, only in the first time do not add this attribute, so —



That’s OK…

Then, is the second function question, how to realize the menu name fuzzy retrieval?

That really stumped me… (It seems that every question is difficult for me, is to ask the net friend to solve)

The preliminary idea is to add a search condition on the basis of the original search function.



Add it at this location.

However, since I initially thought the menu name I wanted to obscure was the field name, I used'%'.like.'%'This syntax can not achieve retrieval, and then thinking about the Menu name removed from a parent table, used to achieve retrieval function, but here reflects my head, because the Menu table retrieved here is equivalent to a parent table, is a Menu management table, Menu name here is the table content…… And my mistake was…



I will from the front end to the background of the function of the related code in the field name of the wrong, write title, but also thought that this is right (not by mistake), and then heart plug changed to name after OK!!

Front-end code implementation

Background code implementation

The generation of this problem shows a very serious problem, if a developer is not familiar with the database, then it will headache dead, all kinds of strange problems, make people mentally and physically exhausted