扫码关注官方订阅号
1.不会显示search在手机输入法中,但是可以使用@keyup.enter事件2.
问题已经解决<form action="javascript:void(0)"><input type="search" @keyup.enter="search()"/></form>
出现“搜索”字样的重点是:
form 元素要有 action 的属性
form
action
input 元素的 type 属性值为 search
input
type
search
但是你这里的 Vue 语法是错误的, 或许你想要的是这样
<template> <form action="#"> <input type="search" @keyup.enter="search"/> </form> </template> <script> export default { // ... methods: { // ... search() { } } }
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
问题已经解决
<form action="javascript:void(0)"><input type="search" @keyup.enter="search()"/></form>
出现“搜索”字样的重点是:
form元素要有action的属性input元素的type属性值为search但是你这里的 Vue 语法是错误的, 或许你想要的是这样