2019-10-24 00:30:52 +08:00
|
|
|
import Component from "@ember/component";
|
2015-08-22 02:39:21 +08:00
|
|
|
import computed from "ember-addons/ember-computed-decorators";
|
|
|
|
|
2019-10-24 00:30:52 +08:00
|
|
|
export default Component.extend({
|
2015-08-22 02:39:21 +08:00
|
|
|
@computed("value")
|
|
|
|
enabled: {
|
|
|
|
get(value) {
|
2018-06-15 23:03:24 +08:00
|
|
|
if (Ember.isEmpty(value)) {
|
|
|
|
return false;
|
|
|
|
}
|
2018-03-05 08:04:23 +08:00
|
|
|
return value.toString() === "true";
|
2015-08-22 02:39:21 +08:00
|
|
|
},
|
|
|
|
set(value) {
|
|
|
|
this.set("value", value ? "true" : "false");
|
|
|
|
return value;
|
|
|
|
}
|
2018-06-15 23:03:24 +08:00
|
|
|
}
|
2015-08-22 02:39:21 +08:00
|
|
|
});
|