murongg / vue3-lazyload

A Vue3.x image lazyload plugin
https://murongg.github.io/vue3-lazyload/
166 stars 19 forks source link

Can this be used with the A-Frame CDN? #1

Closed gmlewis closed 3 years ago

gmlewis commented 3 years ago

I would like to allow one of my Vue3 pages to pull in the A-Frame CDN on-demand but not have to load it into the full Vue3 SPA.

I tried this:

<template>
  <script v-lazy="{ src: 'https://aframe.io/releases/1.1.0/aframe.min.js' }" />
  <a-scene>
     ...
  </a-scene>
</template>

but Vue3 complains with this error message:

VueCompilerError: Tags with side effect (<script> and <style>) are ignored in client component templates.

Do you have any ideas on how this could be used to pull the A-Frame CDN into the Vue3 app lazily?

murongg commented 3 years ago

You want use lazyload plugin load A-Frame CDN resources?

gmlewis commented 3 years ago

You want use lazyload plugin load A-Frame CDN resources?

Yes, but maybe there is a better way that I'm missing?

murongg commented 3 years ago

My plug-in cannot achieve this function,It is only for vue3 <img /> tag!