[Vuejs]-How to add component to this Vue component?

0👍

ugh, I think it is this. Decorators in typescript seem to make the call optional? So the usual component args go inside the decorator call that is implicit if the brackets are not included? I am still just guessing though.

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { Store } from 'vuex';
import { readUserProfile } from '@/store/main/getters';
import VueQueryBuilder from 'vue-query-builder';


@Component({
      components: { VueQueryBuilder },
})
export default class Loop extends Vue {
  get greetedUser() {
    const userProfile = readUserProfile(this.$store);
    if (userProfile) {
      if (userProfile.full_name) {
        return userProfile.full_name;
      } else {
        return userProfile.email;
      }
    }
  }
}

Leave a comment