WeChat applet implements search box function

WeChat applet implements search box function

This article example shares the specific code for the WeChat applet to implement the search box function for your reference. The specific content is as follows

Effect:

wxml file:

<view class="search_input" >
        <navigator url="/pages/search/search" open-type="navigate" class="navigator">
       <text class="iconfont icon-guanbi"></text> Search</navigator>
</view>

The icon style needs to be imported into text, here we use iconfont
url is the page to be redirected

.search_input {
  height: 90rpx;
  background-color: #eb4450;
  padding: 10rpx;
} 
.search_input .navigator{
  background-color: #fff;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 15rpx;
  color: #999;
  font-size: 32rpx;
}

In .js:

If the component references the global style, you need to add the following attributes

options:{
      addGlobalClass:true,
  },

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • WeChat applet implements search box function and pitfalls
  • WeChat applet search box style and jump to the search page (applet search function)
  • WeChat mini program imitates Taobao's hot search words in the search box
  • WeChat applet search box component code example
  • WeChat applet implements top search box

<<:  What the website needs most is to improve the experience of the target user group

>>:  Web Design TabIndex Element

Recommend

CSS3 flexible box flex to achieve three-column layout

As the title says: The height is known, the width...

Summary of special processing statements of MySQL SQL statements (must read)

1. Update the entire table. If the value of a col...

Docker+nacos+seata1.3.0 installation and usage configuration tutorial

I spent a day on it before this. Although Seata i...

Detailed steps for Linux account file control management

In the Linux system, in addition to various accou...

Nginx solves cross-domain issues and embeds third-party pages

Table of contents Preface difficulty Cross-domain...

Example analysis of the impact of MySQL index on sorting

This article uses examples to illustrate the impa...

How to add and delete unique indexes for fields in MySQL

1. Add PRIMARY KEY (primary key index) mysql>A...

Several ways to solve CSS style conflicts (summary)

1. Refine the selector By using combinators, the ...

Should nullable fields in MySQL be set to NULL or NOT NULL?

People who often use MySQL may encounter the foll...

10 Tips to Improve Website Usability

Whether it is a corporate website, a personal blo...

Example of using CSS3 to create Pikachu animated wallpaper

text OK, next it’s time to show the renderings. O...

Summary of Creating and Using Array Methods in Bash Scripts

Defining an array in Bash There are two ways to c...