@@ -540,7 +540,7 @@ const updateColors = (data) => {
540
540
color: data .cssColor ,
541
541
activeComponent: activeComponent .value ,
542
542
routeArray: routes .value [activeRoute .value ],
543
- activeComponentData: activeComponentData,
543
+ activeComponentData: activeComponentData . value ,
544
544
}
545
545
updateColor (payload)
546
546
refresh ();
@@ -555,7 +555,7 @@ const finishedResize = (x, y, w, h) => {
555
555
h: h,
556
556
activeComponent: activeComponent .value ,
557
557
routeArray: routes .value [activeRoute .value ],
558
- activeComponentData: activeComponentData,
558
+ activeComponentData: activeComponentData . value ,
559
559
};
560
560
updateComponentSize (payload);
561
561
updateComponentGridPosition (payload);
@@ -564,11 +564,12 @@ const finishedResize = (x, y, w, h) => {
564
564
565
565
// refresh function
566
566
const refresh = () => {
567
+ console .log (" Inside of refresh" )
567
568
const payload = {
568
569
activeComponent: activeComponent .value ,
569
570
routeArray: routes .value [activeRoute .value ],
570
- activeComponentData: activeComponentData,
571
- z: activeComponentData .z ,
571
+ activeComponentData: activeComponentData . value ,
572
+ z: activeComponentData .value . z ,
572
573
};
573
574
payload .z ++ ;
574
575
updateComponentLayer (payload);
@@ -580,12 +581,13 @@ const refresh = () => {
580
581
console .log (activeComponentData .value , " I AM ACTIVECOMPONENTDATA.value" )
581
582
// drag and drop function
582
583
const finishedDrag = (x , y ) => {
584
+ console .log (" Inside of finishedDrag" )
583
585
let payload = {
584
586
x: x,
585
587
y: y,
586
588
activeComponent: activeComponent .value ,
587
589
routeArray: routes .value [activeRoute .value ],
588
- activeComponentData: activeComponentData,
590
+ activeComponentData: activeComponentData . value ,
589
591
};
590
592
updateComponentPosition (payload);
591
593
updateComponentGridPosition (payload);
@@ -620,14 +622,14 @@ const onActivated = (componentData) => {
620
622
setActiveComponent (componentData .componentName );
621
623
}
622
624
if (componentData && componentData .hasOwnProperty (' componentName' )) {
623
- activeComponentData .isActive = true ;
625
+ activeComponentData .value . isActive = true ;
624
626
}
625
627
}
626
628
627
629
// deactivated is emitted before activated
628
630
const onDeactivated = () => {
629
631
if (activeComponent .value !== " " ) {
630
- activeComponentData .isActive = false ;
632
+ activeComponentData .value . isActive = false ;
631
633
}
632
634
}
633
635
@@ -654,7 +656,7 @@ const submitNote = (e) => {
654
656
if (noteText .value === ' ' ) {
655
657
return ;
656
658
}
657
- addActiveComponentNote (noteText);
659
+ addActiveComponentNote (noteText . value );
658
660
noteText .value = ' ' ;
659
661
}
660
662
@@ -670,11 +672,12 @@ const handleSelect = (value) => { //actually handles adding or deleting
670
672
// user can change component's layer order
671
673
const handleLayer = (e ) => {
672
674
e .preventDefault ();
675
+ console .log (" activeComponent is " , activeComponentData .value )
673
676
const payload = {
674
677
activeComponent: activeComponent .value ,
675
678
routeArray: routes .value [activeRoute .value ],
676
- activeComponentData: activeComponentData,
677
- z: activeComponentData .z ,
679
+ activeComponentData: activeComponentData . value ,
680
+ z: activeComponentData .value . z ,
678
681
};
679
682
680
683
if (e .target .innerText === " +" ) payload .z ++ ;
@@ -697,11 +700,11 @@ const handleRight = (event) => {
697
700
698
701
watch (noteModalOpen, () => {
699
702
noteModal .value = noteModalOpen .value ;
700
- });
703
+ }, {deep : true } );
701
704
702
705
watch (colorModalOpen, () => {
703
706
colorModal .value = colorModalOpen .value ;
704
- });
707
+ }, {deep : true } );
705
708
706
709
707
710
watch (activeComponent, () => {
@@ -711,7 +714,8 @@ const handleRight = (event) => {
711
714
store .commit (" TOGGLE_TUTORIAL" );
712
715
}
713
716
onActivated (activeComponentObj .value );
714
- }
717
+ },
718
+ {deep: true },
715
719
)
716
720
</script >
717
721
0 commit comments