From 236b371b0bc16159b3faab76979de67997642161 Mon Sep 17 00:00:00 2001 From: jlpereira Date: Sun, 16 Mar 2025 20:29:10 -0300 Subject: [PATCH] Add multi layout --- .gitignore | 1 + README.markdown | 47 ++++++++++++++++++++++++++++++++++++++++ src/App.vue | 22 +++++++++++++++++-- src/utils/index.js | 1 + src/utils/loadLayouts.js | 21 ++++++++++++++++++ tailwind.config.cjs | 1 + vite.config.js | 2 +- 7 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 src/utils/loadLayouts.js diff --git a/.gitignore b/.gitignore index 30e63a6..3633253 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ dist-ssr /pages /components /panels +/layouts public README.md *.local diff --git a/README.markdown b/README.markdown index 89c4bfd..578f89b 100644 --- a/README.markdown +++ b/README.markdown @@ -209,6 +209,53 @@ export default { } ``` +### Customizing the Layout + +The application comes with a default layout that includes a header and a footer. If you'd like to replace this layout with your own, you can do so by creating a custom layout file. + +Steps to replace the default layout + +1. In the root folder of your project, create a new folder called `layouts` (if it doesn't already exist). +2. Inside this folder, create a file named default.vue. +3. Define your custom layout structure inside this file as needed. + +Example of layout/default.vue + +```vuejs + +``` + +This custom layout will replace the default one and be applied throughout the application. You can include your own elements, such as a navigation bar or footer, as needed. + +#### Using Multiple Layouts + +In addition to replacing the default layout, you can create multiple layouts by adding more .vue files inside the layout folder. You can then specify which layout to use for a specific page by setting the layout name in the meta property of the `` tag in your Single File Component (SFC). + +JSON5: + +```js + +{ + meta: { + layout: 'custom' + } +} + +``` + +YAML: + +```yaml + +meta: + layout: custom + +``` + ### External panels To add panels in Taxa pages, create a folder called `panels` in your `setup` branch, and inside it create another folder for your panel. For example: `panels/PanelTest` diff --git a/src/App.vue b/src/App.vue index bb29998..45c71d5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,13 +1,31 @@