When you need to modify the requested data. You can use mutate() to directly modify data

By the way, the above example is just a simple example. In real business, if you just make some simple modifications to data, and do not need to use Cache and Preload, we recommended to use computed.

const { data } = useRequest('api/user');
const slogan = computed(() => `Welcome, ${data.value}!`);
Last Updated: 9/4/2021, 11:59:45 AM
Contributors: John