JSFiddle - React, Tailwind, and code Playground

by aadil hasan

HTML

<script src="https://cdn.jsdelivr.net/npm/mini-js/build/mini.min.js"></script>
<h1>
 Mini JS- Conditional rendering exapmle
</h1>
<hr>
</h1>
<div id="app1">
  <br>
  <h2 m-if="show_txt"> Click button below to hide/show this line </h2>
  <br>
  <br>
  <br>
  
  <button m-on:click="toggle_txt_visibility()">
    hide text/show text
  </button>
 

</div>

JavaScript

var app = new Mini({
	el: '#app1',
  data: {
  
  show_txt: true
  
  },
  methods: {
    
      toggle_txt_visibility: function(){
      
        this.show_txt = !this.show_txt;
      
      }
    
    
    }
})