0 votes
in VueJS by
Can I use computed property in another computed property?

1 Answer

0 votes
by

Yes, you can access it directly as you would data props.

For example, the comboTwo computed property uses comboOne computed property as below,

data() {
    return {
        propOne: 'prop1',
        propTwo: 'prop2'
    }
},

computed: {
     comboOne() {
         return this.propOne + ',' + this.propTwo;
     },

     comboTwo() {
        return this.comboOne.split(',').join('-');
    }
}

Related questions

0 votes
asked Sep 14, 2023 in VueJS by AdilsonLima
0 votes
asked Sep 7, 2023 in VueJS by DavidAnderson
...