Skip to content
This repository was archived by the owner on Sep 28, 2024. It is now read-only.

Commit 26daf28

Browse files
committed
Fixes #10 bug with binding element classes and styles
1 parent b790267 commit 26daf28

6 files changed

+17
-12
lines changed

dist/vue-custom-tooltip.cjs.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ var script = vue.defineComponent({
6464
};
6565
vue.onMounted(setCssVars);
6666
return function () { return [
67-
vue.h(props.abbreviation ? 'abbr' : 'span', Object.assign({}, attrs, {
67+
vue.h(props.abbreviation ? 'abbr' : 'span', {
6868
'class': [
69+
attrs.class,
6970
props.position,
7071
// force at least medium size if multiline is true
7172
props.multiline && props.size === 'is-small' ? 'is-medium' : props.size,
@@ -78,8 +79,8 @@ var script = vue.defineComponent({
7879
'data-label': props.label,
7980
'aria-label': props.label,
8081
'role': 'tooltip',
81-
'style': [{ cursor: props.abbreviation ? 'help' : 'pointer' }],
82-
}), slots) ]; };
82+
'style': [{ cursor: props.abbreviation ? 'help' : 'pointer' }, attrs.style],
83+
}, slots) ]; };
8384
},
8485
});
8586

dist/vue-custom-tooltip.esm.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ var script = defineComponent({
6060
};
6161
onMounted(setCssVars);
6262
return function () { return [
63-
h(props.abbreviation ? 'abbr' : 'span', Object.assign({}, attrs, {
63+
h(props.abbreviation ? 'abbr' : 'span', {
6464
'class': [
65+
attrs.class,
6566
props.position,
6667
// force at least medium size if multiline is true
6768
props.multiline && props.size === 'is-small' ? 'is-medium' : props.size,
@@ -74,8 +75,8 @@ var script = defineComponent({
7475
'data-label': props.label,
7576
'aria-label': props.label,
7677
'role': 'tooltip',
77-
'style': [{ cursor: props.abbreviation ? 'help' : 'pointer' }],
78-
}), slots) ]; };
78+
'style': [{ cursor: props.abbreviation ? 'help' : 'pointer' }, attrs.style],
79+
}, slots) ]; };
7980
},
8081
});
8182

dist/vue-custom-tooltip.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adamdehaven/vue-custom-tooltip",
3-
"version": "2.5.0",
3+
"version": "2.5.1",
44
"description": "A customizable, reusable, and reactive tooltip component for Vue 3 (including TypeScript) projects.",
55
"keywords": [
66
"Vue",

src/App.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<p>This is the Vue app.</p>
33
<p>
44
This sentence has a
5-
<vue-custom-tooltip label="This is a tooltip" abbreviation>tooltip in the middle</vue-custom-tooltip>.
5+
<vue-custom-tooltip class="adam-test" label="This is a tooltip" abbreviation
6+
>tooltip in the middle</vue-custom-tooltip
7+
>.
68
</p>
79
</template>
810

src/VueCustomTooltip.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ export default defineComponent({
6969
return () => [
7070
h(
7171
props.abbreviation ? 'abbr' : 'span',
72-
Object.assign({}, attrs, {
72+
{
7373
'class': [
74+
attrs.class,
7475
props.position,
7576
// force at least medium size if multiline is true
7677
props.multiline && props.size === 'is-small' ? 'is-medium' : props.size,
@@ -84,8 +85,8 @@ export default defineComponent({
8485
'data-label': props.label,
8586
'aria-label': props.label,
8687
'role': 'tooltip',
87-
'style': [{ cursor: props.abbreviation ? 'help' : 'pointer' }],
88-
}),
88+
'style': [{ cursor: props.abbreviation ? 'help' : 'pointer' }, attrs.style],
89+
},
8990
slots,
9091
),
9192
]

0 commit comments

Comments
 (0)