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

205
Views
how to add a string to another string in Vue.js

I am working on a Vue project. I tried to add a character to a prop using this code:

mounted() {
  this.link = this.link + '/';
}

the problem is that I getting this error on the console:

Uncaught TypeError: 'set' on proxy: trap returned falsish for property 'link'

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

0

You shouldn't mutate props, one way to do this is to create a computed property:

computed: {
  formattedLink: function() {
    return this.link + '/';
  }
}
about 4 years ago · Juan Pablo Isaza Report

0

From the Vue docs:

All props form a one-way-down binding between the child property and the parent one: when the parent property updates, it will flow down to the child, but not the other way around. This prevents child components from accidentally mutating the parent's state, which can make your app's data flow harder to understand.

You can emit the data from the child component and then listen for it in the parent component for any changes to keep the data in sync.

<child-component :link="value" @updatedLink="link = $event"></child-component>

From the child just emit the updated value.

 mounted() {
  const val = this.link + '/';
  this.$emit('updatedLink', val)
}

You can read more about it here: https://v3.vuejs.org/guide/component-custom-events.html

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!