Skip to content

Commit

Permalink
fix: Now really fixed variable fallthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
icehaunter committed Jul 1, 2021
1 parent e70aaf7 commit c7475db
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/datepicker/Datepicker.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="v3dp__datepicker" :style="variables">
<div class="v3dp__datepicker" :style="variables($attrs.style)">
<div class="v3dp__input_wrapper">
<input
type="text"
Expand Down Expand Up @@ -302,13 +302,10 @@ export default defineComponent({
: props.startingView
})
const variables = computed(() =>
const variables = (object: { style?: Record<string, string> }) =>
Object.fromEntries(
Object.entries(
(attrs?.style as Record<string, string>) ?? {}
).filter(([key, _]) => key.startsWith('--'))
Object.entries(object ?? {}).filter(([key, _]) => key.startsWith('--'))
)
)
return {
input,
Expand All @@ -323,7 +320,7 @@ export default defineComponent({
clearModelValue,
initialView,
log: (e: any) => console.log(e),
variables
variables,
}
},
})
Expand Down

0 comments on commit c7475db

Please sign in to comment.