Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
How to display the getter as text in the template

I have a getter, which I would like to display in the template as text.

The data is already in the getter, checked with devtools vue chrome extension. The data I want to get from the getter looks like this:

["appel", "banaan", "kiwi"]

My component looks like this: (the name of getter is getPlaylist)

<template>
    <div>
      <span>{{ showPlaylist }}</span>
    </div>
<template>

<script>
import { mapGetters } from "vuex";

export default {
  data() {
    return {
    };
  },
  computed: {
    ...mapGetters("app"["getPlaylist"]),

     showPlaylist() {
       this.getPlaylist;
     },
  },
};
</script>

How can I use this getter to show the text of the array?

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Not sure what you're hoping to get with ...mapGetters("app"["getPlaylist"]), but I can't see it doing anything else other than being an undefined

"app" is a string, which doesn't behave like an object or array. the only thing available that could be accessed is string methods (ie "app"["startsWith"]("a")) or characters "app"[2])

if app is a module and getPlaylist the getter, you need to define it as:

computed: {
  ...mapGetters(["app/getPlaylist"]),
}

alternatively if app is another getter...

computed: {
  ...mapGetters(["app","getPlaylist"]),
}

or if app is a namespace

computed: {
  ...mapGetters("app",["getPlaylist"]),
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!