Here's a brief overview of the project I'm currently working on. To maintain confidentiality, I will provide only essential information to explain the issue at hand. This project involves utilizing VUE JS.
The main challenge I'm facing is updating a button's text using a method called 'text' --> {{ text }} //
This is an excerpt of my current setup:
someName: [
{
someKey: "someValue"
},
{
someKey: "notSomeValue"
},
The 'text' method is placed within the computed properties section and is defined as follows:
text() {
return this.someName.filter(u => {
return u.someKey === "someValue" ? "turn off" : "turn on";
})
Instead of displaying the string values as expected, it's showing the objects as the button text. What am I missing here?
I also attempted to store the string value in a data property and display that, but it didn't work either. I anticipated the text to be one of the two strings specified in the conditional statement.