search

Home  >  Q&A  >  body text

javascript - js displays the search function in the mobile phone input method

1.<input type="search" @keyup.enter="search()"/> search will not be displayed in the mobile phone input method, but the @keyup.enter event can be used
2.< ;form action="javascript:search()"><input type="search" @keyup.enter="search()"/></form>
Display search in the mobile phone input method, The @keyup.enter event cannot be used, but enter has an effect.
The effect I want to achieve is to display the search button in the mobile phone input method, and at the same time click the search button in the mobile phone input method to implement the search function. Using vue, it is very Puzzled. .

过去多啦不再A梦过去多啦不再A梦2694 days ago1000

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-07-04 13:47:33

    The problem has been solved
    <form action="javascript:void(0)"><input type="search" @keyup.enter="search()"/></form>

    reply
    0
  • PHP中文网

    PHP中文网2017-07-04 13:47:33

    The key point when the word "Search" appears is:

      The
    1. form element must have the attribute action

    2. The
    3. type

      attribute value of the input element is search

    But your Vue syntax here is wrong, maybe this is what you want

    <template>
    <form action="#">
        <input type="search" @keyup.enter="search"/>
    </form>
    </template>
    
    <script>
    export default {
        // ...
        methods: {
            // ...
            search() {
            }
        }
    }

    reply
    0
  • Cancelreply