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

152
Views
Vue in production breaks app when using v-text in button

I have a strange bug that I've narrowed down, but unfortunately can't create a minimal reproducible example (forgive me!)

I'm using Nuxt.js, Vuetify, Vue.js

When I run in development mode, the app works.

But when I run in production mode, the following component causes the app to freeze (all buttons become unresponsive).

<v-btn nuxt :to="to" color="primary" large v-text="text" />

When I replace v-text="text" with {{ text }} as an inner node, everything begins to work again.

Before (broken)

<v-btn nuxt :to="to" color="primary" large v-text="text" />

After (fixed)

<v-btn nuxt :to="to" color="primary" large>{{ text }}</v-btn>

Does anyone know what would change in Vue production mode, or why v-text would be the culprit?

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I don't have an explanation why it works in development but not production, but that's irrelevant because you shouldn't use v-text on components (unless that component specifically works with v-text).

v-text simply sets the innerText DOM property on the root element of the component; these two are functionally equivalent:

<v-btn v-text="text"></v-btn>
<v-btn :inner-text.prop="text"></v-btn>

Setting innerText will replace all child nodes of the element with a single text node, essentially breaking the component's template.

It's better to set the button content the normal way so the component can slot it in the correct place in the template:

<v-btn>{{ text }}</v-btn>
about 4 years ago · Santiago Trujillo Report

0

Regarding this issue: https://github.com/nuxt/framework/issues/6466#issuecomment-1209742483

It looks like since you're using Nuxt with the whole SSR/rehydration thing + the fact that it messes up with the DOM in a forced way probably doesn't help.

Meanwhile, as mentioned in the other answer: you should not really use this directive anyway, stick to the mustache syntax.

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