JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/[email protected]/lib/index.js"></script>
<div id="app">
<el-button @click="disabled = !disabled">Toggle disabled</el-button>
<el-dropdown>
<span :class="['el-dropdown-link', disabled ? 'is-disabled' : '']">
下拉菜单<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>黄金糕</el-dropdown-item>
<el-dropdown-item>狮子头</el-dropdown-item>
<el-dropdown-item>螺蛳粉</el-dropdown-item>
<el-dropdown-item disabled>双皮奶</el-dropdown-item>
<el-dropdown-item divided>蚵仔煎</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
SCSS
@import url("//unpkg.com/[email protected]/lib/theme-chalk/index.css");
.el-dropdown-link {
color: #409eff
}
.el-dropdown-link.is-disabled {
color: #333;
pointer-events: none;
}
Babel + JSX
new Vue({
data() {
return {
disabled: true
}
}
}).$mount('#app')