Style on a small program using the variable value method

In the development process, typically encountered in non-fixed pattern, this time will use the variable to a predetermined pattern, e.g., a view of the need to use variable width:

1. In wxss, the definition of the variables: width: var (- width--);

2. In js, the definition of variables: viewWidth, and to this variable gives the desired value

3. in xml using wxss variables and variables js: style = "- width--: {{viewWidth}} px"

Guess you like

Origin www.cnblogs.com/jane2160/p/11248603.html