Compare commits
2 Commits
44f26dd330
...
ad3320779c
| Author | SHA1 | Date | |
|---|---|---|---|
| ad3320779c | |||
| 96efb0cf53 |
@@ -1,18 +0,0 @@
|
||||
## vue3 引入@路径
|
||||
path模块问题
|
||||
要安装@type/node:npm install @types/node --save-dev
|
||||
之后就可以加载path
|
||||
import path from "path";
|
||||
resolve: {
|
||||
//配置别名
|
||||
alias: [
|
||||
{
|
||||
find: /^~/,
|
||||
replacement: "",
|
||||
},
|
||||
{
|
||||
find: "@",
|
||||
replacement: path.resolve( __dirname, "src" ),
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -13,6 +13,7 @@
|
||||
"vue-router": "^4.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.2",
|
||||
"@stylistic/eslint-plugin": "^5.5.0",
|
||||
"@types/node": "^24.9.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
||||
@@ -24,7 +25,6 @@
|
||||
"eslint-plugin-vue": "^10.5.1",
|
||||
"path": "^0.12.7",
|
||||
"sass": "^1.93.2",
|
||||
"sass-loader": "^16.0.5",
|
||||
"typescript": "~5.9.3",
|
||||
"vite": "^7.1.12",
|
||||
"vue-eslint-parser": "^10.2.0",
|
||||
@@ -89,7 +89,7 @@
|
||||
},
|
||||
"node_modules/@element-plus/icons-vue": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@element-plus/icons-vue/-/icons-vue-2.3.2.tgz",
|
||||
"resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.2.tgz",
|
||||
"integrity": "sha512-OzIuTaIfC8QXEPmJvB4Y4kw34rSXdCJzxcD1kFStBvr8bK6X1zQAYDo0CNMjojnfTqRQCJ0I7prlErcoRiET2A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
@@ -3203,13 +3203,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/neo-async": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/neo-async/-/neo-async-2.6.2.tgz",
|
||||
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/node-addon-api": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/node-addon-api/-/node-addon-api-7.1.1.tgz",
|
||||
@@ -3580,47 +3573,6 @@
|
||||
"@parcel/watcher": "^2.4.1"
|
||||
}
|
||||
},
|
||||
"node_modules/sass-loader": {
|
||||
"version": "16.0.5",
|
||||
"resolved": "https://registry.npmmirror.com/sass-loader/-/sass-loader-16.0.5.tgz",
|
||||
"integrity": "sha512-oL+CMBXrj6BZ/zOq4os+UECPL+bWqt6OAC6DWS8Ln8GZRcMDjlJ4JC3FBDuHJdYaFWIdKNIBYmtZtK2MaMkNIw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"neo-async": "^2.6.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18.12.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/webpack"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@rspack/core": "0.x || 1.x",
|
||||
"node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
|
||||
"sass": "^1.3.0",
|
||||
"sass-embedded": "*",
|
||||
"webpack": "^5.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@rspack/core": {
|
||||
"optional": true
|
||||
},
|
||||
"node-sass": {
|
||||
"optional": true
|
||||
},
|
||||
"sass": {
|
||||
"optional": true
|
||||
},
|
||||
"sass-embedded": {
|
||||
"optional": true
|
||||
},
|
||||
"webpack": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/scss": {
|
||||
"version": "0.2.4",
|
||||
"resolved": "https://registry.npmmirror.com/scss/-/scss-0.2.4.tgz",
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"vue-router": "^4.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.2",
|
||||
"@stylistic/eslint-plugin": "^5.5.0",
|
||||
"@types/node": "^24.9.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
||||
@@ -25,7 +26,6 @@
|
||||
"eslint-plugin-vue": "^10.5.1",
|
||||
"path": "^0.12.7",
|
||||
"sass": "^1.93.2",
|
||||
"sass-loader": "^16.0.5",
|
||||
"typescript": "~5.9.3",
|
||||
"vite": "^7.1.12",
|
||||
"vue-eslint-parser": "^10.2.0",
|
||||
|
||||
@@ -72,8 +72,7 @@ Copyright © CPIC All rights reserved
|
||||
</el-scrollbar>
|
||||
</template>
|
||||
<script lang="js">
|
||||
// @ts-expect-error 之后再补充类型文件
|
||||
import { hasOnlyChild } from "../../../router/index.ts";
|
||||
import { hasOnlyChild } from "@/router/index.ts";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { computed } from "vue";
|
||||
|
||||
@@ -102,17 +101,6 @@ export default {
|
||||
.sidebar-wrapper {
|
||||
@include no-select;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-moz-user-select: none;
|
||||
/*火狐*/
|
||||
-webkit-user-select: none;
|
||||
/*webkit浏览器*/
|
||||
-ms-user-select: none;
|
||||
/*IE10*/
|
||||
-khtml-user-select: none;
|
||||
/*早期浏览器*/
|
||||
user-select: none;
|
||||
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import { router } from "./router/index.ts";
|
||||
import AppMain from "./AppMain.vue";
|
||||
|
||||
import ElementPlus from "element-plus";
|
||||
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
|
||||
|
||||
import "element-plus/dist/index.css";
|
||||
|
||||
// eslint-disable-next-line
|
||||
@@ -18,6 +20,13 @@ const app = createApp( AppMain );
|
||||
|
||||
app.use( ElementPlus );
|
||||
app.use( router );
|
||||
|
||||
// 引入element-icon
|
||||
for ( const [key, component,] of Object.entries( ElementPlusIconsVue ))
|
||||
{
|
||||
app.component( key, component );
|
||||
}
|
||||
|
||||
app.mount( "#app" );
|
||||
|
||||
// eslint-disable-next-line
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: Kane Wang <wangkane@qq.com>
|
||||
* @Date: 2025-10-13 15:31:41
|
||||
* @LastEditors: Kane Wang
|
||||
* @LastModified: 2025-10-23 17:47:28
|
||||
* @LastModified: 2025-10-24 10:03:13
|
||||
* @FilePath: src/router/index.ts
|
||||
* @Description:
|
||||
*
|
||||
@@ -19,11 +19,59 @@ export declare interface SideBarRouteRecordNormalized extends RouteRecordNormali
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: "/console",
|
||||
name: "Console",
|
||||
path: "/",
|
||||
name: "root",
|
||||
redirect: "Overview",
|
||||
hidden: true,
|
||||
// component: index,
|
||||
},
|
||||
{
|
||||
path: "/desktop",
|
||||
name: "Desktop",
|
||||
meta: {
|
||||
title: "工作台",
|
||||
icon: "house",
|
||||
},
|
||||
component: () => import( "../layout/console/Index.vue" ),
|
||||
children:[
|
||||
{
|
||||
path: "/overview",
|
||||
name: "Overview",
|
||||
meta: {
|
||||
title: "总览",
|
||||
icon: "house",
|
||||
},
|
||||
component: () => import( "@/views/console/desktop/Overview.vue" ),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/data",
|
||||
name: "Data",
|
||||
meta: {
|
||||
title: "制度库管理",
|
||||
icon:"Collection",
|
||||
},
|
||||
component: () => import( "../layout/console/Index.vue" ),
|
||||
children:[
|
||||
{
|
||||
path: "/regulatory-management",
|
||||
name:"RegulatoryManagement",
|
||||
meta: {
|
||||
title: "制度文件管理",
|
||||
icon:"document",
|
||||
},
|
||||
component: ()=> import( "@/views/console/data/RegulatoryManagement.vue" ),
|
||||
},
|
||||
{
|
||||
path: "/department-management",
|
||||
name: "DepartmentManagement",
|
||||
meta:{
|
||||
title: "组织机构管理",
|
||||
icon: "OfficeBuilding",
|
||||
},
|
||||
component: ()=> import( "@/views/console/data/RegulatoryManagement.vue" ),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "@/assets/css/index.scss";
|
||||
@import "@/assets/css/public/mixin.scss";
|
||||
|
||||
.wrapper {
|
||||
@include no-select;
|
||||
@@ -0,0 +1,32 @@
|
||||
<!--
|
||||
author: Kane Wang <wangkane@qq.com>
|
||||
date: 2025-10-23 21:40:24
|
||||
component: RegulatoryManagement
|
||||
Copyright © CPIC All rights reserved
|
||||
-->
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
总览
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "OverViews",
|
||||
setup()
|
||||
{
|
||||
const ui = {};
|
||||
|
||||
return { ui, };
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "@/assets/css/public/mixin.scss";
|
||||
|
||||
.wrapper {
|
||||
@include no-select;
|
||||
|
||||
margin: 5px;
|
||||
border: 1px solid red;
|
||||
}
|
||||
</style>
|
||||
38
开发日志.md
Normal file
38
开发日志.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# 前端
|
||||
|
||||
## 问题
|
||||
|
||||
### vue3 引入@路径
|
||||
|
||||
#### 引入path模块问题
|
||||
|
||||
node.js 自带的path模块,是JavaScript代码,要引入ts文件,需要安装@type/node模块。
|
||||
|
||||
```shell
|
||||
npm install @types/node --save-dev
|
||||
```
|
||||
|
||||
之后就可以加载path。在 vite.config.ts 中加上
|
||||
|
||||
```typescript
|
||||
import path from "path";
|
||||
resolve: {
|
||||
//配置别名
|
||||
alias: [
|
||||
{
|
||||
find: /^~/,
|
||||
replacement: "",
|
||||
},
|
||||
{
|
||||
find: "@",
|
||||
replacement: path.resolve( __dirname, "src" ),
|
||||
},
|
||||
],
|
||||
},
|
||||
```
|
||||
|
||||
## 组件
|
||||
|
||||
### pdf预览组件
|
||||
|
||||
使用
|
||||
Reference in New Issue
Block a user