一生平安,全家幸
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>360T22</title>
</head>
<!-- the viewer container must have a defined size -->
<div id="viewer" style="width: 100vw; height: 90vh;"></div>
<script type="module">
import { Viewer } from "./@photo-sphere-viewer/core";
import { MarkersPlugin } from "./@photo-sphere-viewer/markers-plugin";
import { GalleryPlugin } from "./@photo-sphere-viewer/gallery-plugin";
import { AutorotatePlugin } from "./@photo-sphere-viewer/autorotate-plugin";
import "./@photo-sphere-viewer/core/index.css";
import "./@photo-sphere-viewer/markers-plugin/index.css";
import "./@photo-sphere-viewer/gallery-plugin/index.css";
const viewer = new Viewer({
container: document.querySelector('#viewer'),
panorama: 'image/1.jpg',
});
</script>
</body>
</html>
网页运行报错:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/css". Strict MIME type checking is enforced for module scripts per HTML spec.index.css:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/css". Strict MIME type checking is enforced for module scripts per HTML spec.index.css:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/css". Strict MIME type checking is enforced for module scripts per HTML spec.markers-plugin/:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.gallery-plugin/:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.autorotate-plugin/:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.core/:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
依赖包在本地