JSFiddle - React, Tailwind, and code Playground

by leopoldthecuber

HTML

<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui/lib/index.js"></script>
<div id="app">
  <el-button type="primary" @click="handleClick(1)" :loading="currentLoading === 1">Button</el-button>
  <el-button type="primary" @click="handleClick(2)" :loading="currentLoading === 2">Button</el-button>
</div>

SCSS

@import url("//unpkg.com/element-ui/lib/theme-default/index.css");

Babel + JSX

var Main = {
    data() {
      return {
        currentLoading: null
      }
    },
    methods: {
      handleClick(index) {
        this.currentLoading = index;
      }
    }
  }
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')