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

242
Views
How to access computed properties inside scrip setup?

How do you access a computed property inside <script setup> in vue? I checked the documentation but it does not even mention how to define computed properties inside <script setup>, I got that only from https://stackoverflow.com/a/71459106/2311074

So given the below code, how to access the computed property url inside <script setup>?

<script setup>
import {computed} from 'vue';

const url = computed(() => 'Hallo');

const printUrl = () => {
   // How to access here the computed property url?
   
   this.url // throws TypeError "Cannot read properties of undefined" 
   
   url // <- returns an object of ComputedRefImpl instead of 'Hallo'
}
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Did you try with url.value, computed returns a readonly reactive ref object.

about 4 years ago · Santiago Gelvez 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!