I managed to use vue2 components inside html files when I was using webpack with html loader. Component was simply placed into html template and everything worked out of the box. Eg. index.html
<section class="bg-shadow"> <cover-hero-carousel :backgrounds="{{ hero_backgrounds | json_encode }}" :delay="2000" :duration="3000" > </cover-hero-carousel> </section> I have tried to do the same with Vue3 with Vite, but no success. Is for Vite needed anything special or is simply not possible anymore, to place vue component anywhere into html and would work.
<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/html"> <head> <meta charset="UTF-8"/> <link rel="icon" type="image/svg+xml" href="/vite.svg"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Title</title> </head> <body> <div id="app"> <cover-hero-carousel :backgrounds="{{ hero_backgrounds | json_encode }}" :delay="2000" :duration="3000" > </cover-hero-carousel> </div> <script type="module" src="src/assets/js/main.js"></script> </body> </html>