File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class PsdPlugin implements IPluginTempl {
1818 static apis = [ 'insertPSD' ] ;
1919 constructor ( public canvas : fabric . Canvas , public editor : IEditor ) { }
2020
21- insertPSD ( ) {
21+ insertPSD ( callback ?: ( ) => void ) {
2222 return new Promise ( ( resolve , reject ) => {
2323 selectFiles ( { accept : '.psd' } )
2424 . then ( ( files ) => {
@@ -33,7 +33,7 @@ class PsdPlugin implements IPluginTempl {
3333 console . log ( psdFile , '11111' ) ;
3434 const json = await psdToJson ( psdFile ) ;
3535 // 加载json
36- this . loadJSON ( json ) ;
36+ this . loadJSON ( json , callback ) ;
3737 resolve ( '' ) ;
3838 } ;
3939 }
@@ -42,8 +42,8 @@ class PsdPlugin implements IPluginTempl {
4242 } ) ;
4343 }
4444
45- loadJSON ( json : string ) {
46- this . editor . loadJSON ( json ) ;
45+ loadJSON ( json : string , callback ?: ( ) => void ) {
46+ this . editor . loadJSON ( json , callback ) ;
4747 }
4848}
4949
You can’t perform that action at this time.
0 commit comments