mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-02 12:18:46 +08:00
Button: avoid click event bubbling when disabled
This commit is contained in:
parent
dc77b56d31
commit
e289e86154
@ -13,9 +13,9 @@
|
||||
}
|
||||
]"
|
||||
>
|
||||
<i class="el-icon-loading" v-if="loading"></i>
|
||||
<i :class="'el-icon-' + icon" v-if="icon && !loading"></i>
|
||||
<span v-if="$slots.default"><slot></slot></span>
|
||||
<i class="el-icon-loading" v-if="loading" @click="handleInnerClick"></i>
|
||||
<i :class="'el-icon-' + icon" v-if="icon && !loading" @click="handleInnerClick"></i>
|
||||
<span v-if="$slots.default" @click="handleInnerClick"><slot></slot></span>
|
||||
</button>
|
||||
</template>
|
||||
<script>
|
||||
@ -45,6 +45,11 @@
|
||||
methods: {
|
||||
handleClick(evt) {
|
||||
this.$emit('click', evt);
|
||||
},
|
||||
handleInnerClick(evt) {
|
||||
if (this.disabled) {
|
||||
evt.stopPropagation();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user