Changing Text When Toggled in Vue
Let's make it so that when toggling, the button will have the text of the operation that the button will perform at the moment written on it. To do this, we need to use the ternary operator as follows:
<template>
<button @click="toggle">
{{ visible ? 'hide' : 'show' }}
</button>
</template>
Given three paragraphs and three buttons, make each button toggle its paragraph and change its text accordingly.