Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save blopa/0d97e8ea9ebfbe6e6a451a590a68a35a to your computer and use it in GitHub Desktop.
Save blopa/0d97e8ea9ebfbe6e6a451a590a68a35a 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