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

feat: support for vue sfc & target element click to next step #201

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from

Conversation

Cameron-McBroom
Copy link

@Cameron-McBroom Cameron-McBroom commented Jul 16, 2021

Ability to pass a single file component.

Usage

steps: [
  {
      component: {
	  vue: VButton,
	  content: `Hello World`,
          data: {
            type: "success"
	  },
	  listeners: {
	      click: () => { console.log("clicked button") }
          }
      }
  }
]

Ability to progress the tour when user clicks on target element:

Usage

steps: [
  {
      target: "#button-element",
      // Progresses to next step on click
      targetIsBtn: true
  },
  {
      target: "#button-element2",
      // custom callback
      targetIsBtn: () => { 
        console.log("custom function")
        // call nextstep manually in this case 
        this.$tours["myTour"].nextStep();
      }
  }
]

This adds the ability to pass a single file component.

Usage
-----------------
steps: [
{
    component: {
	vue: VButton,
	content: `Hello World`,
	data: {
		type: "success"
	},
	listeners: {
		click: () => { console.log("Clicked button") }
	}
    }
}
]
New option added to step options to specify that the target is a button.

You can specify true, and with the click of the target element, it will progress to the next step.

You can also pass a function, and this will be called instead of next step to give more flexibility to users.
@Cameron-McBroom Cameron-McBroom changed the title feat: support for vue sfc feat: support for vue sfc & target element click to next step Jul 16, 2021
@LovaszNorbertM
Copy link

Can someone merge this? Please.

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

Successfully merging this pull request may close these issues.

2 participants