⊗jsvuPmCdTT 21 of 72 menu

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.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline