<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      cocos creator 2.4.5 cc-component.vue代碼

      <template>
        <ui-section>
          <div slot="header" class="header flex-1 layout horizontal center-center">
            <ui-checkbox
              :hidden="!editor._showTick"
              v-value="target.enabled.value"
              v-values="target.enabled.values"
              :multi-values="_updateEnableMulti(target.enabled)"
            ></ui-checkbox>
            <span 
              @dragstart="dragstart" 
              @dragend="dragend" 
              draggable="true"
            >
              {{ name }}
            </span>
            <span class="flex-1"></span>
            <ui-button 
              class="tiny transparent"
              :title="T('INSPECTOR.component.help')"
              :hidden="!editor.help"
              @click="openHelpClick"
            >
              <i class="fa fa-book"></i>
            </ui-button>
            <ui-button 
              ref="dropdown" 
              class="tiny transparent"
              title=""
              @click="menuClick"
            >
              <i class="fa fa-cog"></i>
            </ui-button>
          </div>
      
          <template v-if="!customDraw">
            <template v-for="prop in target">
              <component
                v-if="prop.attrs.visible !== false"
                :is="prop.compType"
                :target.sync="prop"
                :indent="0"
                :multi-values="multi"
              ></component>
            </template>
          </template>
        </ui-section>
      </template>
      
      <script>
      export default {
        name: 'cc-comp-section',
        props: {
          name: {
            type: String,
            required: true,
            twoWay: true
          },
          editor: {
            type: Object,
            required: true,
            twoWay: true
          },
          target: {
            type: Object,
            required: true,
            twoWay: true
          },
          index: {
            type: Number,
            default: 0
          },
          count: {
            type: Number,
            default: 0
          },
          multi: {
            type: Boolean,
            default: false
          }
        },
        methods: {
          T: Editor.T, // 假設全局 Editor.T 可用
          
          dragstart(event) {
            event.stopPropagation();
            Editor.UI.DragDrop.start(event.dataTransfer, {
              buildImage: true,
              effect: "copyMove",
              type: "component",
              items: [{ id: this.target.uuid.value, name: this.name }]
            });
          },
          
          dragend() {
            Editor.UI.DragDrop.end();
          },
          
          customDraw() {
            return this.editor && this.editor.inspector;
          },
          
          menuClick(event) {
            event.stopPropagation();
            
            if (this._requestID) {
              Editor.Ipc.cancelRequest(this._requestID);
              this._requestID = null;
            }
            
            this._requestID = Editor.Ipc.sendToPanel(
              "scene", 
              "scene:has-copied-component", 
              (err, hasCopied) => {
                if (err) return;
                
                const dropdownRect = this.$refs.dropdown.$el.getBoundingClientRect();
                const nodeUuids = this.target.node.values.map(node => node.uuid) || [];
                const compUuids = this.target.uuid.values;
                
                Editor.Ipc.sendToPackage(
                  "inspector", 
                  "popup-component-inspector-menu", 
                  {
                    nodeUuids,
                    compUuids,
                    hasCopyComp: hasCopied,
                    multi: this.multi,
                    compIndex: this.index,
                    compCount: this.count,
                    x: dropdownRect.left,
                    y: dropdownRect.bottom + 5
                  }
                );
              },
              -1
            );
          },
          
          openHelpClick(event) {
            event.stopPropagation();
            let helpUrl = this.editor.help;
            
            if (helpUrl.startsWith("i18n:")) {
              helpUrl = Editor.T(helpUrl.replace("i18n:", ""));
            }
            
            require("electron").shell.openExternal(helpUrl);
          },
          
          _updateEnableMulti(prop) {
            if (!prop.values) return false;
            const firstValue = prop.values[0];
            return !prop.values.every(val => val === firstValue);
          }
        },
        mounted() {
          if (this.customDraw() && this.editor.inspector) {
            Editor.import(this.editor.inspector).then(InspectorModule => {
              if (!InspectorModule || typeof InspectorModule !== 'function') {
                console.warn(`Failed to load inspector ${this.editor.inspector} for component "${this.name}"`);
                return;
              }
              
              const createInspector = () => {
                const container = document.createElement('div');
                this.$el.appendChild(container);
                
                new InspectorModule({
                  el: container,
                  propsData: {
                    target: this.target,
                    multi: this.multi
                  }
                });
              };
              
              // 處理依賴項
              const dependencies = InspectorModule.options?.dependencies;
              if (dependencies && dependencies.length > 0) {
                Editor.import(dependencies).then(() => {
                  createInspector();
                });
              } else {
                createInspector();
              }
            });
          }
        },
        beforeDestroy() {
          if (this._requestID) {
            Editor.Ipc.cancelRequest(this._requestID);
          }
        }
      };
      </script>

       

      posted @ 2025-06-05 13:37  浪浪辛  閱讀(12)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 又爽又黄又无遮掩的免费视频| 亚洲成色在线综合网站| 国产美女久久久亚洲综合| 亚洲一区二区中文字幕| 97人人模人人爽人人少妇| 国产精品免费无遮挡无码永久视频| 无码国模国产在线观看免费| 成人免费乱码大片a毛片| 99在线视频免费观看| 大胆欧美熟妇xxbbwwbw高潮了| 国产精品中文字幕在线| 久久香蕉欧美精品| 重口SM一区二区三区视频| 激情综合一区二区三区| 国产精品v欧美精品∨日韩| 亚洲中文字幕久久精品码| 亚洲免费成人av一区| 亚洲精品中文av在线| 国产美女69视频免费观看| 亚洲永久视频| 最近免费中文字幕大全| 久久久久久曰本av免费免费| 肉大捧一进一出免费视频| 中文字幕亚洲综合久久| 国产精品福利自产拍久久| 人摸人人人澡人人超碰97| 国产欧美日韩精品丝袜高跟鞋| 国产精品国产三级国快看| 色婷婷综合久久久中文字幕| 国产精品自在拍在线播放| 国产精品一区二区不卡视频| 亚洲精品国产福利一区二区| 色猫咪av在线网址| 国精品无码一区二区三区在线看 | 亚洲国产午夜精品福利| 亚洲精品日本久久一区二区三区| 国产二区三区不卡免费| 国产一区二区爽爽爽视频| 99久久国产综合精品成人影院| 久久伊99综合婷婷久久伊| 亚洲最大在线精品|