|
@@ -1,7 +1,7 @@
|
|
|
import App from './app.vue'
|
|
|
import { appEl, SceneTypeDesc, scenes } from '@/store'
|
|
|
import { mount, deepIsRevise } from '@/utils'
|
|
|
-import { reactive, ref } from 'vue'
|
|
|
+import { reactive, ref, watchEffect } from 'vue'
|
|
|
|
|
|
import type { Scene } from '@/store'
|
|
|
import type { ModelExpose } from './platform'
|
|
@@ -14,6 +14,9 @@ export type { ModelExpose }
|
|
|
|
|
|
export const fuseModel = Symbol('fuse')
|
|
|
export const currentModel = ref<ModelType>(fuseModel)
|
|
|
+watchEffect(() => {
|
|
|
+ console.error(currentModel.value, 'currentModel')
|
|
|
+}, { flush: 'sync' })
|
|
|
export const modelProps: ModelProps = reactive({ type: currentModel, callback: null })
|
|
|
export const getModelTypeDesc = (model: ModelType) => {
|
|
|
if (model === fuseModel) {
|
|
@@ -36,6 +39,8 @@ const _loadModel = (() => {
|
|
|
let oldResult: Promise<ModelExpose>
|
|
|
|
|
|
return (modelType: ModelType) => {
|
|
|
+ console.log(oldModelType, modelType, 'oldModelType')
|
|
|
+ console.log(deepIsRevise(oldModelType, modelType), 'oldModelType')
|
|
|
if (!deepIsRevise(oldModelType, modelType)) {
|
|
|
return oldResult
|
|
|
}
|
|
@@ -49,6 +54,7 @@ const _loadModel = (() => {
|
|
|
resolve(data)
|
|
|
}
|
|
|
}
|
|
|
+ console.log(modelType, oldModelType, '不是吧')
|
|
|
currentModel.value = modelType
|
|
|
})
|
|
|
}
|