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

Mysql example of splitting into multiple rows and columns by specific symbols

Some fault code tables use the following design p...

MySQL uses the truncate command to quickly clear all tables in a database

1. Execute the select statement first to generate...

Improvement experience and sharing of 163 mailbox login box interactive design

I saw in the LOFTER competition that it was mentio...

Detailed explanation of redundant and duplicate indexes in MySQL

MySQL allows you to create multiple indexes on th...

The perfect solution for MySql version problem sql_mode=only_full_group_by

1. Check sql_mode select @@sql_mode The queried v...

Three methods to modify the hostname of Centos7

Method 1: hostnamectl modification Step 1 Check t...

Import csv file into mysql using navicat

This article shares the specific code for importi...

Example of Form action and onSubmit

First: action is an attribute of form. HTML5 has d...

Forty-nine JavaScript tips and tricks

Table of contents 1. Operation of js integer 2. R...

14 practical experiences on reducing SCSS style code by 50%

Preface Sass is an extension of the CSS3 language...

Several ways to store images in MySQL database

Usually the pictures uploaded by users need to be...