As a newcomer to VUE, I am attempting to dynamically modify the disabled value based on the userAgent in order to display or hide the paymentMethod:
data() {
return {
paymentMothods: [
{ name: 'Visa checkout', img: 'visa.png', disabled: false, height: '19', class: 'v-button' },
{ name: 'PayPal', img: 'paypal.png', disabled: false, height: '18.9', class: '' },
{ name: 'PhonePE', img: 'phonepe.png', disabled: true, height: '18.9', class: 'phonepe' },
]
}
},
If the userAgent is phonepe-webview, I am trying to adjust the value as follows:
methods: {
phopepeMatch: function () {
let userAgent = navigator.userAgent
let phonepeMatch = userAgent.match("phonepe-webview")
if (phonepeMatch === "phonepe-webview"){
this.paymentMothods[2].disabled = false
return true
}
else {
return false
}
}
},
Despite my efforts, the payment method remains invisible :(