集成cesium+vite-plugin-earth
This commit is contained in:
parent
148dec61f4
commit
667c070dd6
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "vite-cesium-sandbox",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc && vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"cesium": "^1.107.0",
|
||||
"vue": "^3.2.47"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^4.1.0",
|
||||
"typescript": "^5.0.2",
|
||||
"vite": "^4.3.9",
|
||||
"vite-plugin-earth": "^2.1.2",
|
||||
"vue-tsc": "^1.4.2"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted } from 'vue';
|
||||
import { Viewer } from 'cesium';
|
||||
onMounted(() => {
|
||||
const viewer = new Viewer('cesiumContainer', { infoBox: false });
|
||||
console.log(viewer);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="cesiumContainer"></div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#cesiumContainer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,5 @@
|
|||
import { createApp } from 'vue'
|
||||
import './style.css'
|
||||
import App from './App.vue'
|
||||
|
||||
createApp(App).mount('#app')
|
|
@ -0,0 +1,8 @@
|
|||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import { cesiumPlugin } from 'vite-plugin-earth';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue(), cesiumPlugin()]
|
||||
});
|
Loading…
Reference in New Issue