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

372
Views
how to call actions from pinia store?

How I can call action from pinia store in vue 3 component? I use composition API. For example, I would like to import 'openLessonCard' - it is action in pinia store. But this method for import don't work..

<script setup>
import { openLessonCard } from '../../stores/lessonsN.js';
import { ref, computed } from 'vue'


defineProps({
  data: {
    type: Object,
    required: true,
  },
  nocollapse: {
  type: Boolean,
  },
});

const reviewLevel = computed(() => {
  return Object.values(this.data.criteria).filter((i) => i === true).length;
})

async function editReviews(id, text, a, b, c, d, e) {
  let review = await this.$api.call("reviews.edit", {
    id,
    text,
    a,
    b,
    c,
    d,
    e,
  });
  this.$Message("ok");
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to create a store instance and call actions

 const store = useLessonsNStore()

 store. openLessonCard()
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!