import { LightningElement,api, track } from 'lwc'; export default class LexCustomInventoryColor extends LightningElement { @api value; @api upperlimit; @api lowerlimit; @api boxPrice; @track showNormal = true; @track showRed = false; @track showYellow = false; connectedCallback(){ console.log('value:'+this.value+"---"+this.upperlimit+"---"+this.lowerlimit); this.showNormal = true; this.showRed = false; this.showYellow = false; if(this.boxPrice == '盒'){ if(this.upperlimit != null && this.lowerlimit != null){ if(this.value > this.upperlimit){ this.showYellow = true; this.showNormal = false; }else if(this.value < this.lowerlimit) { this.showRed = true; this.showNormal = false; } } } } }