修复静默提交时pinia实例未初始化的问题
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "material-editor",
 | 
					  "name": "material-editor",
 | 
				
			||||||
  "private": true,
 | 
					  "private": true,
 | 
				
			||||||
  "version": "1.0.5",
 | 
					  "version": "1.0.6",
 | 
				
			||||||
  "type": "module",
 | 
					  "type": "module",
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
    "dev": "vite",
 | 
					    "dev": "vite",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,7 +46,8 @@ export function UpdateTexture() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
export async function SubmitRawAsync(options: { textureSrc: string }): Promise<{ file: string }>
 | 
					export async function SubmitRawAsync(options: { textureSrc: string }): Promise<{ file: string }>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    const scene = useSceneRaw();
 | 
					    let pinia = createPinia();
 | 
				
			||||||
 | 
					    const scene = useSceneRaw(pinia);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const virtualDom = document.createElement('div');
 | 
					    const virtualDom = document.createElement('div');
 | 
				
			||||||
    virtualDom.style.display = 'none';
 | 
					    virtualDom.style.display = 'none';
 | 
				
			||||||
@@ -56,6 +57,7 @@ export async function SubmitRawAsync(options: { textureSrc: string }): Promise<{
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    scene.Dispose();
 | 
					    scene.Dispose();
 | 
				
			||||||
    virtualDom.remove();
 | 
					    virtualDom.remove();
 | 
				
			||||||
 | 
					    disposePinia(pinia);
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
        file: json
 | 
					        file: json
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user