<input type="checkbox" \# v-model="checked" \# >
EDIT:
I tried using a double escaped \# like this:
<input type="checkbox" \\# v-model="checked" \# >
But it did not work, when I examined the page via chrome dev tool, this is how the input is displayed:
<input type="checkbox" #="" v-model="checked">
The reason for the v-model is that I am trying to do an 'if conditional' in my Vue.js model
. i.e
<script>
const mixin = {
data: function() {
return {
checked:true
}
created() {
this.checked = this.addGoals();
},
methods: {
addGoals() {
if (test === 3){
return true;
}else{
return false;
}
}
</script>
I did try this method to escape the values but it did not work:
<input type="checkbox" #:v-model="checked">
The error message:
Uncaught Error: Invalid template:'
Can you provide more details about the scenario you’re facing and the reason for escaping Vue directives in the template? This will allow me to suggest the most suitable approach tailored to your scenario.
Regards,
Filip
Hello Filip.
Thank you for your reply . I have updated my question. The reason for the v-model is that I am trying to do an 'if conditional' in my Vue.js model. i.e i want to check the input if certain conditions are met,.
Hello,
My colleague has just answered your other thread on the same matter and in order to avoid duplicate discussions, we would like to kindly ask you to continue the conversation only at one place. You can access his reply here:
Thanks Vessy
i have indeed been trying to work out a solution to the problem with your colleague thank you.