Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

132
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda