universal-background ![npm](https://img.shields.io/npm/v/universal-background.svg)
Dynamic setting window background color and so on.
Support
![wechatMiniprogram](https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg)
Install
$ npm install universal-background --save
Methods
setColor(options)
Dynamically sets the background color of the window.
Parameters
Property | Type | Default | Required | Description | Support |
---|
color | String | - | x | The background color of the window must be a hexadecimal color value | ![wechatMiniprogram](https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg) |
topColor | String | - | x | Background color of top window, must be hexadecimal color value, supported by iOS only | ![wechatMiniprogram](https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg) |
bottomColor | String | - | x | Bottom window background color, must be hexadecimal color value, iOS only support | ![wechatMiniprogram](https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg) |
setTextStyle(options)
Dynamic Settings drop - down background font, loading map style.
Parameters
Property | Type | Default | Required | Description | Support |
---|
style | String | | √ | Drop down background font, loading diagram style, value: dark, light | ![wechatMiniprogram](https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg) |
Example
import Background from 'universal-background';
Background.setColor({
color: #000000,
success: res => {
},
fail: res => {
}
});
Background.setTextStyle({
style: 'dark',
success: res => {
},
fail: res => {
}
});