11# VuePal
22
3- VuePal provides a bridge between Drupal and Vue. It comes with a set of components and
4- composables to make your life easier when working with Drupal.
3+ VuePal provides a bridge between Drupal and Vue. It comes with a set of
4+ components and composables to make your life easier when working with Drupal.
55
66## Frontend Routing
77
@@ -17,10 +17,13 @@ export default defineNuxtConfig({
1717})
1818```
1919
20- With this feature enabled, you can create a static frontend page in Nuxt and still use all the routing features of
21- Drupal in your frontend application. You can define your aliases in the frontend page using ` definePageMeta ` . The module
22- will automatically create a Drupal configuration file that can be imported and processed by the
23- [ Drupal frontend_routing] ( https://www.drupal.org/project/frontend_routing ) module.
20+ With this feature enabled, you can create a static frontend page in Nuxt and
21+ still use all the routing features of Drupal in your frontend application. You
22+ can define your aliases in the frontend page using ` definePageMeta ` . The module
23+ will automatically create a Drupal configuration file that can be imported and
24+ processed by the
25+ [ Drupal frontend_routing] ( https://www.drupal.org/project/frontend_routing )
26+ module.
2427
2528``` ts [pages/static-page/example.vue]
2629definePageMeta ({
@@ -46,8 +49,9 @@ export default defineNuxtConfig({
4649})
4750```
4851
49- This option enables the ` useDrupalRoute() ` composable.
50- This composable provides the necessary GraphQL fragment and query to fetch the route data and metatags of a Drupal page.
52+ This option enables the ` useDrupalRoute() ` composable. This composable provides
53+ the necessary GraphQL fragment and query to fetch the route data and metatags of
54+ a Drupal page.
5155
5256## Admin Toolbar
5357
@@ -61,13 +65,13 @@ export default defineNuxtConfig({
6165})
6266```
6367
64- The admin toolbar component fetches the Drupal administration menu and displays it in your frontend application.
68+ The admin toolbar component fetches the Drupal administration menu and displays
69+ it in your frontend application.
6570![ toolbar.png] ( https://github.com/liip/vuepal/blob/main/screenshots/toolbar.png )
6671
6772### Usage
6873
6974``` vue
70-
7175<template>
7276 <ClientOnly>
7377 <div v-if="drupalUser.accessToolbar && !isEditing">
@@ -76,16 +80,15 @@ The admin toolbar component fetches the Drupal administration menu and displays
7680 </ClientOnly>
7781</template>
7882
79-
8083<script setup lang="ts">
81- const route = useRoute()
82- const drupalUser = useDrupalUser()
83- const language = useCurrentLanguage()
84- const isEditing = computed(
85- () =>
86- !!(route.query.blokkliEditing || route.query.blokkliPreview) &&
87- drupalUser.value.accessToolbar,
88- )
84+ const route = useRoute()
85+ const drupalUser = useDrupalUser()
86+ const language = useCurrentLanguage()
87+ const isEditing = computed(
88+ () =>
89+ !!(route.query.blokkliEditing || route.query.blokkliPreview) &&
90+ drupalUser.value.accessToolbar,
91+ )
8992</script>
9093```
9194
@@ -101,11 +104,11 @@ export default defineNuxtConfig({
101104})
102105```
103106
104- The local tasks component fetches the local tasks of a Drupal page and displays them in your frontend application.
107+ The local tasks component fetches the local tasks of a Drupal page and displays
108+ them in your frontend application.
105109![ localtasks.png] ( https://github.com/liip/vuepal/blob/main/screenshots/localtasks.png )
106110
107111``` vue
108-
109112<template>
110113 <ClientOnly>
111114 <div class="flex">
0 commit comments