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

119
Views
Cómo cargar un contenido estático en index.html

Estaba usando vue-cli con webpack para mi proyecto y estaba cargando una imagen en index.html como esta // index.html

 <html> ... <style> .tag1 { background-image: url('<%= require('@/assets/icons/a123.svg') %>'); } </style> ... </html>

¿Cómo cargar el ícono en el archivo index.html basado en vite? url(/assets/icons/a123.svg) pero arroja 404

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Puede crear una función, consulte los documentos de Vite

 const useImage = ((url) => { return new URL(`/src/${url}`, import.meta.url).href; });

y crea una propiedad global en main.js :

 app.config.globalProperties.$image = useImage;

entonces úsalo como:

 $image(imageUrl)
about 4 years ago · Juan Pablo Isaza Report

0

Mueva el archivo svg a la carpeta /public y luego podrá acceder a él como <img src="/a123.svg" />

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!