Optional prop generateOnInit, used in virt reg page
This commit is contained in:
@@ -60,6 +60,13 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
generateOnInit: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
numberOfBallots: 4,
|
||||
@@ -79,12 +86,14 @@ export default {
|
||||
},
|
||||
beforeMount() {
|
||||
this.$emit("numberOfBallots", this.numberOfBallots);
|
||||
if (this.generateOnInit) {
|
||||
this.generateColors();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
numberOfBallots: function() {
|
||||
this.$emit("numberOfBallots", this.numberOfBallots);
|
||||
this.generateColors();
|
||||
this.emitColors();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user