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

117
Vistas
it doesn't rendering about Axios resullt, please

i use vue 3, SshPre for line color

<div class="fileContent" >
            <!-- <ssh-pre language="js" copy-button @copied="onCopiedDoSomething"  label="Javascript" dark=true><pre>{{this.$store.state.git.decodeData}}</pre></ssh-pre> -->
            <ssh-pre language="js"  copy-button label="Javascript" dark=true >
                <pre>{{this.$store.state.git.decodeData}}</pre></ssh-pre>
</div>

in store.js

// in .vue file
...mapMutations({
            setDecodeData : 'git/setDecodeData',
        }),

// in store.js 
setDecodeData(state, data){
          state.decodeData = data
},

setdata functions

sendContent(e){
            this.axios.get(`${e.url}`, {
                    headers : {
                        Authorization : `token ${key}`
                    }
            })
            .then( res => {
                console.log(res)
                this.encodedData = res.data.content
                this.decodeData()
            })
        },

decodeData(){
            this.setDecodeData( decodeURIComponent(escape(window.atob(this.encodedData)))) 
        },

so div.fileContent in ssh-pre tags doesn't live rendering

but this tag can takes live render

<pre>{{this.$store.state.git.decodeData}}</pre>

how can i fix it?? please help me~~

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In template you don't need to use $this remove that. And use mapGetters from vuex if you want to have reactivity with store in your template. Set up getters in your store and access that in your computed which will watch for any changes and update the dom.

In store:

const getters = {
  getDecodeData: (state) => state.decodeData
}

In layout:

computed: {
    ...mapGetters([
      getDecodeData
    ])
  }

<pre>{{getDecodeData}}</pre>

For reference you can read from here: https://vuex.vuejs.org/guide/getters.html#method-style-access

about 4 years ago · Juan Pablo Isaza 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