I have data from server. The response data is integer 1 or 0, In view i use element ui el-switch, it set value with boolean true or false.
And then i'll edit that value and send request to server with new value as an integer value not boolean.
Is there anyway can help me?
On el-switch
you can use properties : active-value
and inactive-value
. Both accept a Number as value matching the active and inactive state.
In your case, you should probably have :
<el-switch
v-model="your_integer_data"
:active-value="1"
:inactive-value="0">
</el-switch>