MCPcopy Create free account
hub / github.com/CoderOpen/waimai / observer

Function observer

front/wxcomponents/vant/button/index.js:39–58  ·  view source on GitHub ↗
(color)

Source from the content-addressed store, hash-verified

37 color: {
38 type: String,
39 observer(color) {
40 let style = '';
41 if (color) {
42 style += `color: ${this.data.plain ? color : 'white'};`;
43 if (!this.data.plain) {
44 // Use background instead of backgroundColor to make linear-gradient work
45 style += `background: ${color};`;
46 }
47 // hide border when color is linear-gradient
48 if (color.indexOf('gradient') !== -1) {
49 style += 'border: 0;';
50 }
51 else {
52 style += `border-color: ${color};`;
53 }
54 }
55 if (style !== this.data.style) {
56 this.setData({ style });
57 }
58 }
59 }
60 },
61 methods: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected