Skip to content

Commit

Permalink
feat: 集成图标模块
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Mar 19, 2023
1 parent 416fbb8 commit b814e0d
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 10 deletions.
12 changes: 8 additions & 4 deletions layouts/vdoing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

<div class="sidebar-mask" @click="methods.toggleSidebar(false)"></div>

<!--
<div v-if="appConfig?.themeConfig?.sidebarHoverTriggerOpen !== false" class="sidebar-hover-trigger"></div>
-->

<!--
<Sidebar :items="sidebarItems" @toggle-sidebar="methods.toggleSidebar" v-show="showSidebar">
Expand All @@ -23,11 +21,14 @@
<div class="sidebar-slot sidebar-slot-bottom" v-html="sidebarSlotBottom"></div>
</template>
<slot name="sidebar-top" #top />
<slot name="sidebar-bottom" #bottom />
<slot name="sidebar-bottom" #bottom />
</Sidebar>
-->

<slot />
<!-- 正文 -->
<div class="content-main">
<slot />
</div>

<!-- 页脚 -->
<Footer />
Expand Down Expand Up @@ -218,6 +219,9 @@ watch(
<style lang="stylus">
@require "../assets/vdoing/styles/index"
.content-main
margin-top 80px
.custom-html-window
position fixed
bottom 0
Expand Down
21 changes: 15 additions & 6 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ console.log("isDev=>", isDev)
console.log("appBase=>", appBase)

export default defineNuxtConfig({
modules: ["@nuxt/content", "nuxt-meilisearch"],
// content
// https://content.nuxtjs.org/guide/writing/content-directory

// meilisearch
// https://github.com/xlanex6/nuxt-meilisearch
// https://docs.meilisearch.com/learn/getting_started/quick_start.html

// unplugin-icons
// https://github.com/antfu/unplugin-icons
modules: ["@nuxt/content", "nuxt-meilisearch", ["unplugin-icons/nuxt", {}]],
content: {
// https://content.nuxtjs.org/api/configuration
},
Expand All @@ -21,11 +30,11 @@ export default defineNuxtConfig({
extends: "../tsconfig.base.json",
},
},
// vite: {
// build: {
// minify: false,
// },
// },
vite: {
build: {
minify: !isDev,
},
},
app: {
baseURL: appBase,
head: {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"prettier": "prettier --write ."
},
"devDependencies": {
"@iconify/json": "^2.2.36",
"@nuxt/content": "^2.5.2",
"@nuxtjs/eslint-config-typescript": "^12.0.0",
"@types/lodash": "^4.14.191",
Expand All @@ -33,6 +34,7 @@
"stylelint-stylus": "^0.18.0",
"stylus": "^0.59.0",
"typescript": "^4.9.5",
"unplugin-icons": "^0.15.3",
"vue-tsc": "^1.2.0"
},
"dependencies": {
Expand Down
5 changes: 5 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<div>
<icon-accessibility />
<icon-account-box style="font-size: 2em; color: red" />

<div style="margin-top: 100px" v-for="testItem in testItems.items">
index
<p>{{ testItem }}</p>
Expand All @@ -12,6 +15,8 @@ import ZhiUtil from "~/utils/zhiUtil"
import { version } from "~/package.json"
import Env from "zhi-env"
import ThemeFromEnum from "~/utils/enums/themeFromEnum"
import IconAccessibility from "~icons/carbon/accessibility"
import IconAccountBox from "~icons/mdi/account-box"
const nuxtEnv = useRuntimeConfig()
const env = new Env(nuxtEnv)
Expand Down
71 changes: 71 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions types/custom.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// declare module "vue-instantsearch/vue3/es"
declare module "vue-instantsearch/vue3/es"
declare module "good-storage"
declare module "~icons/*" {
import { FunctionalComponent, SVGAttributes } from "vue"
const component: FunctionalComponent<SVGAttributes>
export default component
}

0 comments on commit b814e0d

Please sign in to comment.