Blogger Information
Blog 17
fans 0
comment 0
visits 14580
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
微信小程序实现搜索框功能
P粉676693833
Original
1704 people have browsed it

这篇文章主要为大家详细介绍了微信小程序实现搜索框功能,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
wxml文件:

  1. <view class="search_input" >
  2. <navigator url="/pages/search/search" open-type="navigate" class="navigator">
  3. <text class="iconfont icon-guanbi"></text> 搜索
  4. </navigator>
  5. </view>
  6. text中需要导入图标样式,这里利用的是iconfont
  7. ```url是要跳转的页面
  8. ```php
  9. .search_input {
  10. height: 90rpx;
  11. background-color: #eb4450;
  12. padding: 10rpx;
  13. }
  14. .search_input .navigator{
  15. background-color: #fff;
  16. height: 100%;
  17. display: flex;
  18. justify-content: center;
  19. align-items: center;
  20. border-radius: 15rpx;
  21. color: #999;
  22. font-size: 32rpx;
  23. }

.js中:

如果是组件引用全局样式,需要加如下属性

php options:{ addGlobalClass:true, },以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

您可能感兴趣的文章:

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post