-
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.
- Loading branch information
Showing
33 changed files
with
588 additions
and
161 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script setup lang="ts"> | ||
import type { ButtonGroupProps } from "./types"; | ||
import { provide, reactive, toRef } from "vue"; | ||
import { BUTTON_GROUP_CTX_KEY } from "./constants"; | ||
defineOptions({ | ||
name: "ErButtonGroup", | ||
}); | ||
const props = defineProps<ButtonGroupProps>(); | ||
provide( | ||
BUTTON_GROUP_CTX_KEY, | ||
reactive({ | ||
size: toRef(props, "size"), | ||
type: toRef(props, "type"), | ||
disabled: toRef(props, "disabled"), | ||
}) | ||
); | ||
</script> | ||
|
||
<template> | ||
<div class="er-button-group"> | ||
<slot></slot> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
@import "./style.css"; | ||
</style> |
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,5 @@ | ||
import type { InjectionKey } from "vue"; | ||
import type { ButtonGroupContext } from "./types"; | ||
|
||
export const BUTTON_GROUP_CTX_KEY: InjectionKey<ButtonGroupContext> = | ||
Symbol("buttonGroupContext"); |
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import Button from "./Button.vue"; | ||
import ButtonGroup from "./ButtonGroup.vue"; | ||
import { withInstall } from "@eric-ui/utils"; | ||
|
||
export const ErButton = withInstall(Button); | ||
export const ErButtonGroup = withInstall(ButtonGroup); | ||
|
||
export * from "./types"; |
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
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
Oops, something went wrong.