vue预览全景图片

vue预览全景图片

  • 安装
shell 复制代码
npm i photo-sphere-viewer --save
  • 使用
html 复制代码
<template>
	<div id="pano" ref="panoshow"></div>
</template>

<script>
import { Viewer } from "photo-sphere-viewer";
import "photo-sphere-viewer/dist/photo-sphere-viewer.css";

export default {
	name: "HomeView",
	data() {
		return {
			PSV: null,
		};
	},
	mounted() {
		this.$nextTick(() => {
			this.initPhotoSphere();
		});
	},
	methods: {
		initPhotoSphere() {
			this.PSV = new Viewer({
				container: document.getElementById("pano"),
				panorama: require("../assets/img/1.jpg"),
				autorotateDelay: true,
				autorotateSpeed: 0,
				size: {
					width: "100%",
					height: "100%",
				},
				maxFov: 100,
				minFov: 10,
				navbar: false,
			}).on("ready", () => {
				console.log("pano ok");
			});
		},
	},
};
</script>

附件

相关推荐
快乐小土豆~~2 小时前
echarts柱状图的X轴label过长被重叠覆盖
前端·javascript·vue.js·echarts
儒雅的烤地瓜2 小时前
Vue | Vue3中<script setup>用法详解
vue.js·vue3·选项式api·组合式 api·setup方法·<script setup>
小李子呢02112 小时前
前端八股2---Proxy 代理
前端·javascript·vue.js
bjzhang753 小时前
使用 HTML + JavaScript 实现组织架构图
前端·javascript·html·组织架构图
军军君013 小时前
Three.js基础功能学习十六:智能黑板实现实例三
前端·javascript·css·vue.js·3d·前端框架·threejs
qq_20815408853 小时前
瑞树6代流程分析
javascript·python
军军君013 小时前
Three.js基础功能学习十四:智能黑板实现实例一
前端·javascript·css·typescript·前端框架·threejs·智能黑板
xiaotao1314 小时前
JS new 操作符完整执行过程
开发语言·前端·javascript·原型模式
吴声子夜歌4 小时前
ES6——数组的扩展详解
前端·javascript·es6
guhy fighting4 小时前
new Map,Array.from,Object.entries的作用以及使用方法
开发语言·前端·javascript