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

141
Views
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 answers
Answer question

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 Report
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!