diff --git a/src/components/MemoryCard.js b/src/components/MemoryCard.js index 2d984f9..b20c021 100644 --- a/src/components/MemoryCard.js +++ b/src/components/MemoryCard.js @@ -77,7 +77,7 @@ export default Blits.Component('MemoryCard', { } }) }, - focus(e) { + focus() { this.scale = 1.08 const message = 'Card ' + (this.index + 1) + (this.disabled ? ' (disabled)' : '') this.announcement = this.$announcer.speak(message) diff --git a/src/pages/Focus.js b/src/pages/Focus.js index 22a8e71..2f9bf7c 100644 --- a/src/pages/Focus.js +++ b/src/pages/Focus.js @@ -137,7 +137,7 @@ export default Blits.Component('Focus', { left() { this.index = Math.max(1, this.index - 1) }, - right(e) { + right() { this.index = Math.min(3, this.index + 1) // this.parent.$focus(e) }, diff --git a/src/pages/RouterHooks.js b/src/pages/RouterHooks.js index ec448cb..4e6a772 100644 --- a/src/pages/RouterHooks.js +++ b/src/pages/RouterHooks.js @@ -8,6 +8,9 @@ const hookPageTemplate = { color="#fff" :effects="[{type: 'radialGradient', props: {colors: ['#b43fcb', '#6150cb'], pivot: [0.5, 1.1], width: 2400, height: 800}}]" > + + + @@ -48,6 +51,7 @@ const hookPageTemplate = { right: 'right', down: 'down', left: 'left', + stateInfo: '', } }, } @@ -121,6 +125,21 @@ const Rating = Blits.Component('RouterHookRating', { //movie flow page, with 2 directions left: back, right: next episode const Episode = Blits.Component('RouterHookEpisode', { ...hookPageTemplate, + hooks: { + init() { + // Get router state information + const state = this.$router?.state + if (!state) return + + // Display available router state information + this.stateInfo = JSON.stringify({ + path: state.path || '', + params: state['params'] || {}, + data: state['data'] || {}, + }) + }, + }, + state() { return { title: 'Episode', @@ -134,10 +153,14 @@ const Episode = Blits.Component('RouterHookEpisode', { this.$router.back() }, right() { - //trigger router to navigate to the next episode, and NOT save current episode page in navigation history - this.$router.to(`/examples/router-hooks/episode/${this.page.id + 1}`, undefined, { - inHistory: false, - }) + //trigger router to navigate to the next episode without adding to navigation history + this.$router.to( + `/examples/router-hooks/episode/${Number(this.$router.state['params'].id) + 1}`, + undefined, + { + inHistory: false, + } + ) }, }, })