init
This commit is contained in:
42
xhs-mini-demos/common/component/api-status/index.js
Normal file
42
xhs-mini-demos/common/component/api-status/index.js
Normal file
@@ -0,0 +1,42 @@
|
||||
const formatJsonForNotes = require("../../../util/formatJson");
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
success: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
fail: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
complete: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
text: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
showStatus: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
}
|
||||
},
|
||||
|
||||
data: {
|
||||
formatText: ''
|
||||
},
|
||||
|
||||
observers: {
|
||||
text(value) {
|
||||
let t = '';
|
||||
try {
|
||||
t = formatJsonForNotes(value);
|
||||
} catch(err) {
|
||||
t = value || '无返回值';
|
||||
}
|
||||
this.setData('formatText', t);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user