I have a checkbox ponent defined like so:
let checkbox = this.$createElement(VCheckbox, {
props: {
hideDetails: true
}
});
In my code I can get a reference to this ponent. In other words I have access to this checkbox
variable. What I want is to set property programmatically. By property I mean this part of the ponent:
props: {
hideDetails: true
}
What I want is to set indeterminate
to true. Something like:
checkbox.setProperty('indeterminate', true);
But I'm unable to find in documenation anything related to my problem. So, how can I implement this?
I have a checkbox ponent defined like so:
let checkbox = this.$createElement(VCheckbox, {
props: {
hideDetails: true
}
});
In my code I can get a reference to this ponent. In other words I have access to this checkbox
variable. What I want is to set property programmatically. By property I mean this part of the ponent:
props: {
hideDetails: true
}
What I want is to set indeterminate
to true. Something like:
checkbox.setProperty('indeterminate', true);
But I'm unable to find in documenation anything related to my problem. So, how can I implement this?
Share Improve this question asked Apr 18, 2019 at 12:26 JacobianJacobian 10.9k32 gold badges140 silver badges233 bronze badges 11-
this.hideDetails = true
is not working ? – John Commented Apr 18, 2019 at 12:42 - No, it is not.. – Jacobian Commented Apr 18, 2019 at 12:45
-
So why you don't create a dynamic variable in data ?
hideDetails: this.state
– John Commented Apr 18, 2019 at 12:52 - @John. Nice tip, I will check it in a minute. – Jacobian Commented Apr 18, 2019 at 12:55
- Did you solve your problem ? – John Commented Apr 18, 2019 at 14:07
2 Answers
Reset to default 4You can create a dynamic variable in your data scope :
data: function() {
return {
stateDetails: true
};
}
Then use it in your props :
props: {
hideDetails: this.stateDetails
}
And now you can change the value like that :
this.stateDetails = true / false
You could try
let checkbox = this.$createElement(VCheckbox, {
ref:"refToElement",
props: {
hideDetails: true
}
});
this.$refs.refToElement.$el.setProperty('indeterminate', true);