update 0.13.1
This commit is contained in:
		| @@ -2,7 +2,7 @@ | ||||
|  * @Author: yehuozhili | ||||
|  * @Date: 2021-02-25 21:16:58 | ||||
|  * @LastEditors: yehuozhili | ||||
|  * @LastEditTime: 2022-01-12 17:26:07 | ||||
|  * @LastEditTime: 2022-04-04 20:17:55 | ||||
|  * @FilePath: \dooringx\packages\dooringx-lib\src\config\index.tsx | ||||
|  */ | ||||
| import React from 'react'; | ||||
| @@ -451,9 +451,16 @@ export class UserConfig { | ||||
| 		return JSON.parse(json); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * 重设store并根据store重设 | ||||
| 	 * @param {IStoreData[]} data | ||||
| 	 * @memberof UserConfig | ||||
| 	 */ | ||||
| 	resetData(data: IStoreData[]) { | ||||
| 		this.store.resetToInitData(data, true); | ||||
| 		this.toRegist(); | ||||
| 		this.animateFactory.syncStoreToConfig(this); | ||||
| 	} | ||||
|  | ||||
| 	getWrapperMove() { | ||||
| @@ -478,6 +485,9 @@ export class UserConfig { | ||||
| 	getStoreChanger() { | ||||
| 		return this.storeChanger; | ||||
| 	} | ||||
| 	getAnimateFactory() { | ||||
| 		return this.animateFactory; | ||||
| 	} | ||||
| 	getConfig() { | ||||
| 		return this.initConfig; | ||||
| 	} | ||||
|   | ||||
| @@ -163,6 +163,26 @@ export class AnimateFactory { | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * 将store中的配置写入config | ||||
| 	 * 注意!只在导入新store后使用 | ||||
| 	 * @memberof AnimateFactory | ||||
| 	 */ | ||||
| 	syncStoreToConfig(config: UserConfig) { | ||||
| 		const store = config.getStore(); | ||||
| 		let data: IStoreData; | ||||
| 		const isEdit = config.getStoreChanger().isEdit(); | ||||
| 		if (isEdit) { | ||||
| 			const origin = config.getStoreChanger().getOrigin()!; | ||||
| 			data = origin.data[origin.current]; | ||||
| 		} else { | ||||
| 			data = store.getData(); | ||||
| 		} | ||||
| 		const dataAnimate = data.globalState?.customAnimate; | ||||
| 		this.customAnimateName = [...dataAnimate]; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * 将用户输入转换为新的动画 | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * @Author: yehuozhili | ||||
|  * @Date: 2021-03-14 05:35:15 | ||||
|  * @LastEditors: yehuozhili | ||||
|  * @LastEditTime: 2021-07-20 16:18:29 | ||||
|  * @LastEditTime: 2022-04-04 20:13:58 | ||||
|  * @FilePath: \dooringx\packages\dooringx-lib\src\hooks\index.ts | ||||
|  */ | ||||
| import { useEffect, useMemo, useState } from 'react'; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 yehuozhili
					yehuozhili