Have this html
<f7-input type="switch" :checked="{typeS}"></f7-input>
JS (vue)
export default {
data() {
type: []
},
mounted: function () {
this.fetchType();
},
methods: {
fetchType: function(){
var typeS = [];
this.$http.get('http://re/api/data').then(function(response){
this.type = response.body.object[0].type;
if(this.type = 'S') {
typeS = 'true'
}
}, function(error){
console.log(error.statusText);
});
},
}
}
and i need when if(this.type = 'S') change inputn attribute on checked. I'm already confused about what's what. Can someone help?