|
@@ -1,5 +1,7 @@
|
|
|
<template>
|
|
|
- <div class="table-operator-item flex valign-center" @click="onClick(data)">
|
|
|
+ <div class="table-operator-item flex valign-center" :class="{
|
|
|
+ disabled
|
|
|
+ }" @click="onBtnClick">
|
|
|
<slot name="icon"><i :class="icon"></i></slot><span><slot /></span>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -22,8 +24,28 @@ export default {
|
|
|
required: true,
|
|
|
type: Function
|
|
|
}
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onBtnClick () {
|
|
|
+ if (this.disabled) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.onClick(this.data)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss"></style>
|
|
|
+<style lang="scss">
|
|
|
+.table-operator-item {
|
|
|
+ &.disabled {
|
|
|
+ cursor: not-allowed;
|
|
|
+
|
|
|
+ * {
|
|
|
+ color: #CCCCCC !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|