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

Slot for override label didn't work till pass a label! #134

Open
Ge6ben opened this issue Jan 26, 2025 · 0 comments
Open

Slot for override label didn't work till pass a label! #134

Ge6ben opened this issue Jan 26, 2025 · 0 comments

Comments

@Ge6ben
Copy link

Ge6ben commented Jan 26, 2025

I was trying to override the label, and it did not work till I found that if I pass a label when overridden, it works! it should work without passing any label. ?

My code:

<template>
  <g-gantt-chart
    bar-end="endDate"
    bar-start="beginDate"
    chart-end="15.12.2022"
    chart-start="01.01.2022"
    date-format="DD.MM.YYYY"
    grid
    precision="month"
    width="100%"
  >
    <g-gantt-row v-for="(item, index) in monthBarList1" :key="index" :bars="[item]" highlight-on-hover label="i should pass this till slot works!">
      <template #label>
        <div style="height: 100%">
          <img
            height="30"
            src="https://user-images.githubusercontent.com/28678851/148047714-301f07df-4101-48b8-9e47-1f272b290e80.png"
            style="padding-right: 10px"
            width="30"
          />
          Label with image
        </div>
      </template>
    </g-gantt-row>
  </g-gantt-chart>
  <b-button @click="addBar">Add Bar</b-button>
</template>

<script setup>
import { ref } from 'vue';

const monthBarList1 = ref([
  {
    beginDate: '01.01.2022',
    endDate: '02.02.2022',
    ganttBarConfig: {
      id: '5621987352',
      label: "I'm in a bundle",
      hasHandles: true,
      bundle: 'myBundle',
      style: {
        background: '#1c8745',
        color: 'white',
        borderRadius: '20px'
      }
    }
  }
]);

const addBar = () => {
  const bar = {
    beginDate: '01.02.2022',
    endDate: '02.03.2022',
    ganttBarConfig: {
      id: 'teesrt1',
      hasHandles: true,
      label: 'Hello!',
      style: {
        background: '#5484b7',
        borderRadius: '20px',
        color: 'white'
      }
    }
  };
  monthBarList1.value.push(bar);
};

 
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant