Initial commit
Made-with: Cursor
This commit is contained in:
19
srde/miniprogram/components/status-badge/status-badge.ts
Normal file
19
srde/miniprogram/components/status-badge/status-badge.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
const STATUS_TEXT: Record<string, string> = {
|
||||
tradable: '可交易',
|
||||
compressed: '风险压缩',
|
||||
locked: '锁仓',
|
||||
};
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
status: { type: String, value: 'tradable' },
|
||||
text: { type: String, value: '' },
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
const s = this.properties.status;
|
||||
const t = this.properties.text || STATUS_TEXT[s] || s;
|
||||
this.setData({ text: t });
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user