Skip to content
On this page

SatPanel公共UI组件

基础用法

vue
<script setup lang="ts">
import { type SatTaskViewItem, type SatMenuItem } from '../packages/main'
const myComponentData: SatMenuItem & SatTaskViewItem = reactive({
  name: 'MyComponent',
  label: '我的组件',
  icon: {
    class: 'fa-paper-plane-o',
  },
  enable: true,
  active: true,
  eleId: 'MyComponent',
  onActive() {
    changeDataActive(this, true)
  },
})
const changeDataEnable = (item: SatMenuItem, flag: boolean) => {
  item.enable = flag
  item.active = flag
}
const changeDataActive = (item: SatMenuItem, flag: boolean) => {
  item.active = flag
}
</script>
<template>
  <SatGlobe>
    <SatPanel
      v-if="myComponentData.enable"
      v-show="myComponentData.active"
      :id="myComponentData.eleId"
      :is-minimize="true"
      :minimize-event="() => changeDataActive(myComponentData, false)"
      :close-event="() => changeDataEnable(myComponentData, false)"
      :is-close="true"
      :title="myComponentData.name"
      :drag-initial-value="{ x: 40, y: 30 }"
    >
      my-component
    </SatPanel>
  </SatGlobe>
</template>

属性

参数说明类型可选值默认值
title必传。头部标题string--
is-drag是否可拖拽booleantrue/falsetrue
drag-initial-value面板初始位置,绝对定位SatPanelPosition: { x: number, y: number }-{ x: 40, y: 30 }
is-maximize移动端模式下是否显示最大化按钮booleantrue/falsetrue
window-size移动端模式下窗口大小stringMaximize/NomalNomal
is-minimize是否显示最小化按钮booleantrue/falsefalse
is-close是否显示关闭按钮booleantrue/falsefalse
minimize-event点击最小化按钮事件() => void--
close-event点击关闭按钮事件() => void--

插槽

插槽名说明
-自定义内容

Released under the MIT License.