I"m going to assign the default value of 1 to the value of the drop-down box and bind this variable;
<select v-model="selectValue"></select>
but just let
data(){
return{ selectValue:1 }
}
this type of writing is not readable, so I want to declare a constant, because many pages use this constant,
, so I put it in the state of vuex;
state: {
//
SINGLE_GAME: 1
}
then I introduce state,data directly into the component
data(){
return{ selectValue:this.SINGLE_GAME }
}
this way of writing is more readable;
but cannot assign a value to selectValue, but in
created()
Print in method
this.SINGLE_GAME
but you can print out the value;
then I don"t know what to do,
because I"m going to use
v-model
bind this variable, so you should not use
computed
,