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('-');
    }
}
...