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

285
Views
¿Cómo editar datos en un archivo JS desde un archivo .VUE?

PRUEBA.VUE

 <template> <div> <button @click="test()">test</button> <button @click="adddata()">add</button> </div> </template> <script> import logs from './data.js' export default { data () { return { logitems: logs.data().infomation, } }, methods:{ test(){ console.log(logs.data().infomation) }, adddata(){ //FAIL logs.data().infomation.log1d = logs.data().infomation.log1d+1 console.log(logs.data().infomation) //PASS this.logitems.log1d=this.logitems.log1d+1 console.log(this.logitems) } } } </script>

DATOS.JS

 export default { data() { return { infomation: { log1d: 1, logDetail: "This is some log detail for log 1", logType: "general", createdBy: "name", CreatedAt: "date", }, }; }, };

del código anterior Si ejecuto los DATOS obtenidos en TEST.VUE, puedo actualizar los datos. Pero si obtengo datos de DATA.JS cuando obtengo datos, la información no se actualizará. ¿Qué puedo hacer para modificar los datos de DATA.JS?

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