MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / initSize

Function initSize

public/iframe/lib/js/mixinsComponents.js:2619–2650  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

2617 }
2618 },
2619 initSize(item) {
2620 Object.keys(item).map(key => {
2621 switch (key) {
2622 case 'rotate':
2623 {
2624 const elementRef = this.$refs[`chartBox${item.elementId}`] // 用ref代替
2625 elementRef && (elementRef[0].style.transform = `rotate(${item[key]}deg)`)
2626 };
2627 break;
2628 case 'width':
2629 case 'height':
2630 case 'left':
2631 case 'top':
2632 {
2633 if (this.basicConfig.zoomMode.default === 'YOY') {
2634 this.setValue(item, key, item[key])
2635 } else {
2636 let basicConfigKey = key
2637 if (key === 'left') basicConfigKey = 'width'
2638 if (key === 'top') basicConfigKey = 'height'
2639 this.setValue(item, key, `${item[key] / this.basicConfig[basicConfigKey] * 100}%`)
2640 }
2641 };
2642 break;
2643 case 'zIndex':
2644 {
2645 this.setValue(item, key, item[key])
2646 };
2647 break;
2648 }
2649 })
2650 },
2651 async initPage() {
2652 // 渲染数据
2653 this.templateList.sort((a, b) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected