Skip to content

Commit

Permalink
feat: add a nav example
Browse files Browse the repository at this point in the history
  • Loading branch information
MarleneJiang committed Jan 18, 2023
1 parent 3964ffa commit 6e87092
Show file tree
Hide file tree
Showing 9 changed files with 296 additions and 54 deletions.
Binary file modified backend/.tmp/data.db
Binary file not shown.
40 changes: 14 additions & 26 deletions backend/config/plugins.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
// // file: config/plugins.js
// "use strict";

// module.exports = () => ({
// // ...
// "entity-relationship-chart": {
// enabled: true,
// config: {
// // By default all contentTypes and components are included.
// // To exlclude strapi's internal models, use:
// exclude: [
// "strapi::core-store",
// "webhook",
// "admin::permission",
// "admin::user",
// "admin::role",
// "admin::api-token",
// "plugin::upload.file",
// "plugin::i18n.locale",
// "plugin::users-permissions.permission",
// "plugin::users-permissions.role",
// ],
// },
// },
// // ...
// });
module.exports = ({ env }) => ({
// ..
'transformer': {
enabled: true,
config: {
prefix: '/api/',
responseTransforms: {
removeAttributesKey: true,
removeDataKey: true,
}
}
},
// ..
});
6 changes: 4 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"@strapi/plugin-i18n": "4.5.6",
"@strapi/plugin-users-permissions": "4.5.6",
"@strapi/strapi": "4.5.6",
"better-sqlite3": "^8.0.1"
"better-sqlite3": "^8.0.1",
"strapi-plugin-navigation": "^2.2.3",
"strapi-plugin-transformer": "^2.2.0"
},
"author": {
"name": "ByteDream"
Expand All @@ -29,4 +31,4 @@
"npm": ">=6.0.0"
},
"license": "MIT"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2023-01-18T09:37:29.331Z"
"x-generation-date": "2023-01-18T16:10:56.728Z"
},
"x-strapi-config": {
"path": "/documentation",
Expand Down
2 changes: 1 addition & 1 deletion backend/src/extensions/documentation/public/index.html

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/components/Header/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup>
</script>

<template>
Expand Down
14 changes: 4 additions & 10 deletions frontend/components/Nav/index.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
<script setup>
const NavList = reactive([{
name: '首页',
path: '/',
},
{
name: '关于',
path: '/about',
}])
const { data: NavList } = await useFetch('http://127.0.0.1:1337/api/navs')
</script>

<template>
<div class="view-nav">
11{{ NavList }}
<div class="nav-list">
<li v-for="item in NavList" :key="item.path">
<NuxtLink :to="item.path">
<li v-for="item in NavList.data" :key="item.url">
<NuxtLink :to="item.url">
{{ item.name }}
</NuxtLink>
</li>
Expand Down
10 changes: 5 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"typecheck": "tsc --noEmit --incremental false",
"lint:strict": "eslint --max-warnings=0 ."
},
"dependencies": {
"@nuxt/image": "^0.7.1",
"@nuxt/image-edge": "^1.0.0-27840416.dc1ed65",
"nuxt-umami": "^1.2.0"
},
"devDependencies": {
"@antfu/eslint-config": "^0.30.1",
"@commitlint/cli": "^17.4.2",
Expand All @@ -34,11 +39,6 @@
"vite": "^3.2.1",
"vue": "^3.2.45"
},
"dependencies": {
"@nuxt/image": "^0.7.1",
"@nuxt/image-edge": "^1.0.0-27840416.dc1ed65",
"nuxt-umami": "^1.2.0"
},
"lint-staged": {
"**/*.{js,ts,vue,html}": [
"eslint --max-warnings=0"
Expand Down
Loading

0 comments on commit 6e87092

Please sign in to comment.