Commit 4a7ba866 by liuchuanming

reShowTextStyle

1 parent d4cdded8
...@@ -130,6 +130,7 @@ export default { ...@@ -130,6 +130,7 @@ export default {
return new Promise((resolve)=>{ return new Promise((resolve)=>{
switch (data.type) { switch (data.type) {
case 1: case 1:
this.activateTextMode();
this.editorInstance. this.editorInstance.
addText(data.content, { addText(data.content, {
position: { position: {
...@@ -139,12 +140,20 @@ export default { ...@@ -139,12 +140,20 @@ export default {
}) })
.then(function (objectProps) { .then(function (objectProps) {
console.log(objectProps); console.log(objectProps);
// 重置 TextStyle
this.editorInstance.changeTextStyle(objectProps.id, {
fontSize: data.fontSize,
fill: data.fontColor,
textAlign: data.fontTextAlign === 1 ? 'left' :
data.fontTextAlign === 2 ? 'center' : 'right'
});
resolve(); resolve();
}); });
break; break;
case 2: case 2:
case 3: case 3:
this.activateImageMode()
this.editorInstance.addImageObject( this.editorInstance.addImageObject(
data.type === 2 ? data.imgPath : data.type === 2 ? data.imgPath :
data.imgPath === this.qrCodeUrl ? qrCodeImage : data.imgPath data.imgPath === this.qrCodeUrl ? qrCodeImage : data.imgPath
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!