123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <template>
- <view class="search-container">
- <view class="search-box">
- <input
- v-model="searchQuery"
- type="text"
- @input="onSearchInput"
- @confirm="onSearch"
- />
- <button @click="onSearch">搜索</button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- searchQuery: ''
- };
- },
- methods: {
- onSearchInput() {
-
- console.log('当前输入内容:', this.searchQuery);
- },
- onSearch() {
-
- console.log('开始搜索:', this.searchQuery);
- }
- }
- };
- </script>
- <style scoped>
- .search-container {
- align-items: center;
- justify-content: center;
- padding-top: 50px;
- height: auto;
- display: flex;
- width: 100%;
- }
- .search-box {
- width: 90%;
- display: flex;
- gap: 0;
- }
- input {
- flex: 1;
- height: 50px;
- padding: 15px;
- border: 1px solid #ccc;
- border-radius: 4px 0 0 4px;
- box-sizing: border-box;
- }
- button {
- padding: 15px 25px;
- background-color: #007AFF;
- height: 50px;
- color: white;
- border: none;
- border-radius: 0 4px 4px 0;
- cursor: pointer;
- white-space: nowrap;
-
- display: flex;
- align-items: center;
- justify-content: center;
- }
- button:hover {
- background-color: #0056b3;
- }
- </style>
|