Skip to content

Commit

Permalink
chore(docs): add examples for plugin usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Rigon committed Mar 24, 2024
1 parent 6897f90 commit 1afcd9a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "vue-screen-docs",
"version": "2.0.0-alpha.0",
"license": "MIT",
"private": true,
"scripts":{
Expand Down
26 changes: 26 additions & 0 deletions packages/docs/src/guide/configuration/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,29 @@ Config can be either:
```
Please refer to [Composition API configuration](/guide/configuration/composition-api) for the signatures of each property.
## Using `screen` and `grid` properties in your components
### With composition API
```vue
<script setup>
import { inject } from 'vue'

const grid = inject('grid');
const screen = inject('screen')
</script>
```
### With options API
```vue
export default {
onMounted() {
console.log({
screen: this.$screen,
grid: this.$grid,
})
}
}
```
1 change: 0 additions & 1 deletion packages/e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "vue-screen-e2e",
"version": "2.0.0-alpha.0",
"license": "MIT",
"private": true,
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion packages/examples/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "vue-screen-examples",
"private": true,
"version": "2.0.0-alpha.0",
"scripts": {
"serve": "vite"
},
Expand Down

0 comments on commit 1afcd9a

Please sign in to comment.