Is recommended to use async for computed properties?

Posted by Jennifer | Updated on

No, it is not recommended. Computed properties should be synchronous. But if you still use asynchronous actions inside them, they may not work as expected and can lead to an unexpected behaviour.

For example, the below usage of async/await is not recommended,

Note: If you still prefer to use async computed properties for some reason then you can consider using additional plugin such as vue-async-computed.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers