Skip to content

Commit 824422d

Browse files
committed
Delete provide/inject decorator example
1 parent 6b5ad36 commit 824422d

File tree

1 file changed

+4
-37
lines changed

1 file changed

+4
-37
lines changed

docs/patterns/README.md

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,10 @@ With above example component hierarchy, in order to derive data from `parent-com
871871

872872
### Provide / Inject
873873

874+
::: tip
875+
You can also use [vue-property-decorator](https://github.com/kaorun343/vue-property-decorator)'s `@Provide`, `@Inject`
876+
:::
877+
874878
```js
875879
// ThemeProvider
876880

@@ -931,43 +935,6 @@ export default {
931935
<ThemeButton secondary>Themed Button</ThemeButton>
932936
</ThemeProvider>
933937

934-
### [@Provide / @Inject Decorator](https://github.com/kaorun343/vue-property-decorator)
935-
936-
```js
937-
// ParentComponent.vue
938-
939-
import { Component, Vue, Provide } from 'vue-property-decorator';
940-
941-
@Component
942-
export class ParentComponent extends Vue {
943-
@Provide
944-
theme = {
945-
primaryColor: 'blue',
946-
};
947-
}
948-
```
949-
950-
```vue
951-
// GrandChildComponent.vue
952-
953-
<template>
954-
<button :style="{ backgroundColor: primary && theme.primaryColor }">
955-
<slot></slot>
956-
</button>
957-
</template>
958-
959-
<script>
960-
import { Component, Vue, Inject, Prop } from 'vue-property-decorator';
961-
962-
export class GrandChildComponent extends Vue {
963-
@Inject() theme;
964-
965-
@Prop({ default: true })
966-
primary: boolean;
967-
}
968-
</script>
969-
```
970-
971938
## Handling Errors
972939

973940
### `errorCaptured` Hook

0 commit comments

Comments
 (0)