Skip to content

Commit

Permalink
fix: component names
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszflorczak committed Feb 15, 2023
1 parent 45354b4 commit f607915
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@ npm install vue-wrap-balancer

## Usage

The simplest way is to wrap the text content with `<Balancer>`:
The simplest way is to wrap the text content with `<WrapBalancer>`:

```vue
<script setup>
import Balancer from 'vue-wrap-balancer'
import WrapBalancer from 'vue-wrap-balancer'
</script>
<template>
<h1>
<Balancer>My Title</Balancer>
<WrapBalancer>My Title</WrapBalancer>
</h1>
</template>
```

If you have multiple `<Balancer>` components used, it’s recommended (but optional) to use `<Provider>` to wrap the entire app. This will make them share the re-balance logic and reduce the HTML size:
If you have multiple `<WrapBalancer>` components used, it’s recommended (but optional) to use `<BalancerProvider>` to wrap the entire app. This will make them share the re-balance logic and reduce the HTML size:

```vue
<script setup>
import { Provider } from 'vue-wrap-balancer'
import { BalancerProvider } from 'vue-wrap-balancer'
</script>
<template>
<Provider>
<BalancerProvider>
<App />
</Provider>
</BalancerProvider>
</template>
```

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function createScriptElement(injected: boolean, suffix?: string) {
})
}

export const Provider = defineComponent({
export const BalancerProvider = defineComponent({
name: 'BalancerProvider',
setup(_props, { slots }) {
provide('BALANCER_CONTEXT', true)
Expand All @@ -91,7 +91,7 @@ export const Provider = defineComponent({
})

export default defineComponent({
name: 'Balancer',
name: 'WrapBalancer',
props: {
/**
* The HTML tag to use for the wrapper element.
Expand Down

0 comments on commit f607915

Please sign in to comment.