Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] XGanttColumn 的 label 希望支援插槽 #44

Closed
imlinhanchao opened this issue May 26, 2023 · 3 comments
Closed

[FEATURE] XGanttColumn 的 label 希望支援插槽 #44

imlinhanchao opened this issue May 26, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@imlinhanchao
Copy link

可能有场景需要在 label 添加一些按钮之类。现在的 label 只能是文本。希望把 label 开放出来可自定义的插槽。

@imlinhanchao imlinhanchao added the enhancement New feature or request label May 26, 2023
@jeremyjone
Copy link
Collaborator

具体讲一下

@imlinhanchao
Copy link
Author

希望达成下面这种效果,通过 x-gantt-columnlabel 插槽。可以在表头额外添加一些组件实现一些特殊的功能。

<x-gantt
    data-id="id"
    :data="dataList"
    :ref="ganttRef"
    start-key="planStartTime"
    end-key="planEndTime"
    @row-click="rowClick"
  >
    <x-gantt-column  prop="name">
        <!--在表头添加搜索框-->
        <template #label>
            标题 <el-input  type="text" placeholder="搜索标题" />
        </template>
    </x-gantt-column>
    <x-gantt-column label="进度" prop="progress" />
    <x-gantt-column label="开始日期" width="100">
      <template #default="{ row }">
        <el-date-picker
          class="date-picker"
          v-model="row.planStartTime"
          type="date"
          placeholder="选择日期"
          size="small"
          style="width: 100%"
          :clearable="false"
          value-format="YYYY-MM-DD"
        />
      </template>
    </x-gantt-column>
    <x-gantt-column label="结束日期" width="100">
      <template #default="{ row }">
        <el-date-picker
          class="date-picker"
          v-model="row.planEndTime"
          type="date"
          placeholder="选择日期"
          size="small"
          style="width: 100%"
          :clearable="false"
          value-format="YYYY-MM-DD"
        />
      </template>
    </x-gantt-column>
    <!--在表头添加设置按钮-->
    <x-gantt-column>
        <template #label>
            <el-button icon="el-icon-setting" @click="setting" />
        </template>
    </x-gantt-column>
</x-gantt>

@jeremyjone
Copy link
Collaborator

这个看情况吧。。。表头的插槽考虑的东西比较多,目前没有特别的想法,后续可能会考虑吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants