diff options
author | charlesh88 <charlesh88@gmail.com> | 2020-04-08 02:25:10 +0300 |
---|---|---|
committer | charlesh88 <charlesh88@gmail.com> | 2020-04-08 02:25:10 +0300 |
commit | 78083138838ad14c9fa96714cfa203c12d8e567f (patch) | |
tree | c01da4f418ea641d14aca7eac8cf0d0d881c5367 | |
parent | a2114ca0081b47a283e7e96407bbc5d73b24f64d (diff) |
Change `cwHasUrl` method to computedui-fixes-0401
- Per PR review comments 4/7/2020;
- Renamed to `urlDefined` and moved to computed property;
-rw-r--r-- | src/plugins/conditionWidget/components/ConditionWidget.vue | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/conditionWidget/components/ConditionWidget.vue b/src/plugins/conditionWidget/components/ConditionWidget.vue index 58f1dd4ac..03b282cff 100644 --- a/src/plugins/conditionWidget/components/ConditionWidget.vue +++ b/src/plugins/conditionWidget/components/ConditionWidget.vue @@ -21,9 +21,9 @@ *****************************************************************************/ <template> -<component :is="cwHasUrl ? 'a' : 'span'" +<component :is="urlDefined ? 'a' : 'span'" class="c-condition-widget" - :href="cwHasUrl ? internalDomainObject.url : null" + :href="urlDefined ? internalDomainObject.url : null" > <div class="c-condition-widget__label"> {{ internalDomainObject.label }} @@ -39,6 +39,11 @@ export default { internalDomainObject: this.domainObject } }, + computed: { + urlDefined() { + return this.internalDomainObject.url && this.internalDomainObject.url.length > 0; + } + }, mounted() { this.unlisten = this.openmct.objects.observe(this.internalDomainObject, '*', this.updateInternalDomainObject); }, @@ -50,9 +55,6 @@ export default { methods: { updateInternalDomainObject(domainObject) { this.internalDomainObject = domainObject; - }, - cwHasUrl() { - return this.internalDomainObject.url && this.internalDomainObject.url.length > 0; } } } |