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

134
Vistas
How could I change my html into a vue component?

I want to view a tiff file in a web page, I can finish it with test.html, but I need to do it in a vue file, how can I do that? and I can't know what the exact content in the tiff.js[![enter image description here][1]][1]

<script src="./jquery-2.0.3.min.js"></script>
  <script src="./bootstrap.min.js"></script>
  <script src="./src/assets/js/tiff.js"></script>
  <script type="text/javascript">$(function () {
function show(file) {
  var reader = new FileReader();
  reader.onload = (function (theFile) {
    return function (e) {
      var buffer = e.target.result;
      var tiff = new Tiff({buffer: buffer});
      var canvas = tiff.toCanvas();
      var width = tiff.width();
      var height = tiff.height();
      if (canvas) {
        $('#output').empty().append(canvas);
      }
    };
  })(file);
  reader.readAsArrayBuffer(file);
}

$('#file').on('change', function (event) {
  show(event.target.files[0]);
});
});</script>

that's what the script I used.

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

0

You could install tiff.js as a npm library npm i tiff https://www.npmjs.com/package/tiff

And then import tiff to the App.vue for example, other codes go to mounted(){}.

Instead of Jquery, you could use event on vue template directly, or use javascript to query the element. Using Jquery with Vue is redundant Ithink

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