43 lines
659 B
JavaScript
43 lines
659 B
JavaScript
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);
|
|
}
|
|
}
|
|
});
|