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