Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save blopa/9212da355a69b4f41fe5def3434f7da8 to your computer and use it in GitHub Desktop.

Select an option

Save blopa/9212da355a69b4f41fe5def3434f7da8 to your computer and use it in GitHub Desktop.
Code for post "I built a retro RPG game shop extension for my Magento 2 store"
methods: {
onMenuItemClick(selection) {
if (selection === 'Talk') {
const randomIndex = Math.floor(Math.random() * this.talkLines.length);
this.currentTalkLine = this.talkLines[randomIndex];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment