Skip to content
This repository was archived by the owner on Jul 12, 2020. It is now read-only.

Commit 7acb04f

Browse files
openorcloseyamgent
authored andcommitted
Revert "Refactor trigger to style text if no add-class (#112)" (#113)
add-class should only add classes to a component, not selectively decide what styles to add. This reverts commit 593169d.
1 parent 593169d commit 7acb04f

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/trigger.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<span ref="trigger" :class="[addClass || (this.trigger === 'click' ? 'click-trigger' : 'other-trigger')]"><slot></slot></span>
2+
<span ref="trigger" :class="[addClass]"><slot></slot></span>
33
</template>
44

55
<script>
@@ -31,6 +31,15 @@
3131
}
3232
this._triggerBy && this._triggerBy.toggle(e)
3333
})
34+
35+
if (this.trigger === 'click') {
36+
this.$refs.trigger.style['cursor'] = 'pointer'
37+
this.$refs.trigger.style['-webkit-text-decoration'] = 'underline dashed';
38+
this.$refs.trigger.style['text-decoration'] = 'underline dashed';
39+
} else {
40+
this.$refs.trigger.style['-webkit-text-decoration'] = 'underline dotted';
41+
this.$refs.trigger.style['text-decoration'] = 'underline dotted'
42+
}
3443
},
3544
methods: {
3645
setTriggerBy (vm) {
@@ -41,11 +50,5 @@
4150
</script>
4251

4352
<style>
44-
.click-trigger {
45-
cursor: pointer;
46-
text-decoration: underline dashed;
47-
}
48-
.other-trigger {
49-
text-decoration: underline dotted;
50-
}
53+
5154
</style>

0 commit comments

Comments
 (0)