-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: v-model issue in UiHorizontalPaging stories (#493)
* fix: remove quote's from getArgTypes props default values * fix: aliased import in UiMenu * fix: v-model issue in UiHorizontalPaging stories * feat: add useArgs composable
- Loading branch information
Showing
4 changed files
with
39 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { | ||
computed, | ||
useAttrs, | ||
} from "vue"; | ||
|
||
export function useArgs(excludedAttrs:string[] = []) { | ||
const attrs = useAttrs(); | ||
const args = computed(() => (Object.keys(attrs).reduce((object, key) => { | ||
if (!excludedAttrs.includes(key)) { | ||
return { | ||
...object, | ||
[key]: attrs[key], | ||
}; | ||
} | ||
return object; | ||
}, {}))); | ||
return { | ||
attrs, | ||
args | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters