Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

96
Vistas
vue - interpolation html value

there is a v-data-table with server side pagination, where I used a formatter for a specific column as described to this topic.

the need is to replace it with HTML and not plain text. For example my function is like :

    formatCurrency (value) {
        return '<strong>' + value + '</strong>';
        //'<v-icon dark small>tick-outline</v-icon>' + value;
    },

when I using this getting the pure HTML.... as :

enter image description here

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Try to use v-html directive :

new Vue({
  el: '#demo',
  data() {
    return {
      price: 555.33
    }
  },
  methods: {
    formatCurrency (value) {
      return '<strong>' + value + '</strong>';
        //'<v-icon dark small>tick-outline</v-icon>' + value;
    },
  }
})

Vue.config.productionTip = false
Vue.config.devtools = false
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="demo">
 <div v-html="formatCurrency(price)"></div> 
</div>

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda