Home  >  Article  >  WeChat Applet  >  Mini program dynamic control component display and hiding

Mini program dynamic control component display and hiding

不言
不言Original
2018-07-14 14:30:268947browse

This article mainly introduces the display and hiding of dynamic control components of small programs. It has certain reference value. Now I share it with everyone. Friends in need can refer to it

The component has an attribute: hidden='', the value is true/false. When false, it means not hidden. When true, it means hidden. Note that the hiding does not retain the position of the component.

The implementation is to use .js with the .wxml file

1. Page({} under the .js file ) Inside the data:{}, create a Boolean type attribute

 

2. Build a view component under the .wxml file

 

Verification:

1, false, when not hiding

 

2. true, when hidden

 

The above is the entire content of this article. I hope it will be helpful to everyone’s learning. For more related content, please pay attention to PHP Chinese net!

Related recommendations:

The page of the mini program uses the function of nine-square grid and item jump

How to implement the mini program Let the swiper component realize the function of the carousel chart

The method of mini program to realize the tab option function of the homepage


The above is the detailed content of Mini program dynamic control component display and hiding. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn