wangqiujuan0808 2023-12-08 22:33:10 +08:00
parent 100f535f02
commit 620710b9a5
4 changed files with 14 additions and 2 deletions

View File

@ -41,7 +41,8 @@
"troisjs": "^0.3.4", "troisjs": "^0.3.4",
"vue": "3.2.45", "vue": "3.2.45",
"vue-cropper": "1.0.3", "vue-cropper": "1.0.3",
"vue-router": "4.1.4" "vue-router": "4.1.4",
"mitt": "^3.0.1"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "3.1.0", "@vitejs/plugin-vue": "3.1.0",

2
src/utils/bus.js Normal file
View File

@ -0,0 +1,2 @@
import mitt from 'mitt'
export default mitt()

View File

@ -12,6 +12,8 @@
<script setup> <script setup>
import bimStore from '@/store/modules/bim'; import bimStore from '@/store/modules/bim';
import { nextTick } from "vue"; import { nextTick } from "vue";
import bus from '@/utils/bus.js'
const myTree = ref("myTree"); const myTree = ref("myTree");
const props = defineProps({ const props = defineProps({
@ -164,7 +166,10 @@ const handleNodeClick = (value) => {
bimStore().setActivateTree(value); bimStore().setActivateTree(value);
} }
const isParent = value.children.length > 0; const isParent = value.children.length > 0;
emit('handleNodeClick', value, isParent) emit('handleNodeClick', value, isParent);
bus.emit('foo');
} }

View File

@ -21,6 +21,7 @@ import {
// import renderModel from "../renderModel"; // import renderModel from "../renderModel";
import homeIcon from '@/assets/image/bg7.jpg' import homeIcon from '@/assets/image/bg7.jpg'
import TWEEN from "@tweenjs/tween.js"; import TWEEN from "@tweenjs/tween.js";
import bus from '@/utils/bus.js'
let scene = ref(null); let scene = ref(null);
let renderer = ref(null); let renderer = ref(null);
@ -59,6 +60,9 @@ watch(() => props.sceneUrl, val => {
loadSence(); loadSence();
}); });
onMounted(() => { onMounted(() => {
bus.on('foo', e => {
})
init(); init();
loadSence(); loadSence();
// //