shipshapecode / shepherd

Guide your users through a tour of your app
https://shepherdjs.dev
Other
13.02k stars 648 forks source link

Inconsistent behaviour with dynamic content #2992

Open muhammadrasyid-prog opened 1 month ago

muhammadrasyid-prog commented 1 month ago

is it possible if angle Shepherd initializes the tour with dynamic content, I have tried it but the tour doesn't work even though I have done a console log and the log results appear

` private addDashboardTourSteps() {

  if (!this.tour || this.dataListTour.value.length === 0) {
    console.log("Tour tidak ada atau tidak ada data tour untuk ditambahkan.");
    return;
}

this.dataListTour.value.forEach(tour => {
    console.log(`Menambahkan langkah untuk tour: ${tour.tour_uuid}`);
    console.log(`Konten: ${tour.content}`);
    console.log(`Elemen ID: ${tour.element_id}`);
    console.log(`Penempatan: ${tour.placement}`);
      this.tour?.addSteps([
          {
              id: tour.tour_name, 
              text: tour.content, // Menggunakan konten dari data
              attachTo: {
                  element: tour.element_id, // Menentukan elemen yang dilampirkan
                  on: tour.placement, // Menentukan penempatan
              },
              buttons: [
                  {
                      text: 'Next',
                      action: this.tour?.next, // Tombol untuk melanjutkan ke langkah berikutnya
                  },
              ],
          },
      ]);
  });`
RobbieTheWagner commented 3 weeks ago

@muhammadrasyid-prog I am unsure what you are asking. Can you please elaborate and possibly provide a reproduction?