Skip to content

Commit

Permalink
fix(attrs): use seperated attributes to prevent style prop warning
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenWesterlaken committed May 18, 2022
1 parent 3901262 commit 4a92362
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/vue-wavify.vue
@@ -1,8 +1,8 @@
<template>
<div class="vue-wavify-wave" ref="wave" v-on="$listeners" :id="id" :style="style">
<div class="vue-wavify-wave" ref="wave" v-on="$listeners" :id="id" :style="separatedAttrs.style">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" >
<slot></slot>
<path :d="this.path" :fill="fill" v-bind="$attrs"/>
<path :d="this.path" :fill="fill" v-bind="separatedAttrs.rest"/>
</svg>
</div>
</template>
Expand Down Expand Up @@ -39,10 +39,6 @@ export default {
id: {
default: null,
type: String
},
style: {
default: null,
type: String
}
},
data() {
Expand All @@ -62,6 +58,12 @@ export default {
window.cancelAnimationFrame(this.$frameId);
this.$frameId = 0;
},
computed: {
separatedAttrs () {
const { style,...rest } = this.$attrs;
return { style, rest };
},
},
methods: {
containerWidth () {
return this.$refs.wave.offsetWidth;
Expand Down

0 comments on commit 4a92362

Please sign in to comment.