Skip to content

Commit

Permalink
feat(generator): added character generator
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinTh committed Jul 21, 2021
1 parent ea7eee4 commit 7272ce5
Show file tree
Hide file tree
Showing 2 changed files with 483 additions and 1 deletion.
15 changes: 14 additions & 1 deletion components/Generators.vue
Expand Up @@ -11,6 +11,12 @@
title="Lieu :"
@refresh="refreshPlace"
/>

<BaseGenerator
v-model="character"
title="Personnage :"
@refresh="refreshCharacters"
/>
</div>
</template>

Expand All @@ -21,11 +27,13 @@ import BaseGenerator from '~/components/BaseGenerator.vue'
import {randFromArray} from '~/helpers/utils'
import places from '~/data/places.yaml'
import characters from '~/data/characters.yaml'
@Component({components: {BaseGenerator}})
export default class Generators extends Vue {
theme = generateTheme()
place: string = ''
character: string = ''
refreshTheme() {
this.theme = generateTheme()
Expand All @@ -35,8 +43,13 @@ export default class Generators extends Vue {
this.place = randFromArray(places as string[])
}
mounted() {
refreshCharacters() {
this.character = randFromArray(characters as string[])
}
created() {
this.refreshPlace()
this.refreshCharacters()
}
}
</script>

0 comments on commit 7272ce5

Please sign in to comment.