Commit 39418e0b by licheng

init

parents
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript'
],
parserOptions: {
ecmaVersion: 'latest'
},
rules: {
'vue/multi-word-component-names': 'off'
}
}
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.tsbuildinfo
node_modules
\ No newline at end of file
{
"recommendations": [
"Vue.volar",
"dbaeumer.vscode-eslint"
]
}
# risk-control-bigScreen
This template should help get you started developing with Vue 3 in Vite.
## Recommended IDE Setup
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
## Type Support for `.vue` Imports in TS
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
## Customize configuration
See [Vite Configuration Reference](https://vitejs.dev/config/).
## Project Setup
```sh
npm install
```
### Compile and Hot-Reload for Development
```sh
npm run dev
```
### Type-Check, Compile and Minify for Production
```sh
npm run build
```
### Lint with [ESLint](https://eslint.org/)
```sh
npm run lint
```
/// <reference types="vite/client" />
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "risk-control-bigscreen",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --build --force",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
"dependencies": {
"axios": "^1.7.7",
"element-plus": "^2.8.2",
"pinia": "^2.1.7",
"vue": "^3.4.29",
"vue-router": "^4.3.3"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.8.0",
"@tsconfig/node20": "^20.1.4",
"@types/node": "^20.14.5",
"@vitejs/plugin-vue": "^5.0.5",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/tsconfig": "^0.5.1",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.23.0",
"npm-run-all2": "^6.2.0",
"sass": "^1.78.0",
"sass-loader": "^16.0.1",
"typescript": "~5.4.0",
"vite": "^5.3.1",
"vite-plugin-svg-icons": "^2.0.1",
"vue-tsc": "^2.0.21"
}
}
<template>
<router-view />
</template>
<script setup lang="ts">
</script>
<style lang="scss" scoped></style>
\ No newline at end of file
<template>
<svg :width="size + 'px'" :height="size + 'px'">
<!-- xlink:href 是使用哪个svg的图标 fill是更改图标的颜色 -->
<use :xlink:href="prefix + name" :fill="color"></use>
</svg>
</template>
<script setup lang="ts">
defineProps({
// xlink:href的属性值前缀
prefix: {
type: String,
default: '#icon-',
},
// 需要使用的svg的图标的名字
name: {
type: String,
required: true,
},
// 需要使用的svg的图标的颜色
color: {
type: String,
default: '#fff',
},
// 需要使用的svg的图标的尺寸
size: {
type: String,
default: '18'
}
})
</script>
\ No newline at end of file
import './styles/index.scss'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
const app = createApp(App)
app.use(createPinia())
app.use(router)
app.use(ElementPlus)
app.mount('#app')
import { createRouter, createWebHashHistory } from 'vue-router'
const router = createRouter({
history: createWebHashHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: () => import('@/views/home/index.vue')
},
]
})
export default router
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const doubleCount = computed(() => count.value * 2)
function increment() {
count.value++
}
return { count, doubleCount, increment }
})
@use './variable.scss' as *;
// 覆盖修改element-plus主题色
@forward 'element-plus/theme-chalk/src/common/var.scss' with ($colors: ('primary': ('base': $primaryColor,
),
'success': ('base': $successColor,
),
'warning': ('base': $warningColor,
),
'danger': ('base': $dangerColor,
),
'error': ('base': $errorColor,
),
'info': ('base': $infoColor,
),
),
);
@use "element-plus/theme-chalk/src/index.scss" as *; // 引入白天模式所有样式
@use "element-plus/theme-chalk/src/dark/css-vars.scss" as *; // 引入黑夜模式所有样式
/* 克隆并自定义 ElMessage 样式,不会影响 ElMessage 原本样式,在 src/utils/message.ts 中调用自定义样式 ElMessage 方法即可,暗黑模式在 src/style/dark.scss 文件进行了适配 */
.pure-message {
padding: 10px 13px !important;
background: #fff !important;
border-width: 0 !important;
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px #00000014,
0 9px 28px 8px #0000000d !important;
&.el-message.is-closable .el-message__content {
padding-right: 17px !important;
}
& .el-message__content {
color: #000000d9 !important;
pointer-events: all !important;
background-image: initial !important;
}
& .el-message__icon {
margin-right: 8px !important;
}
& .el-message__closeBtn {
right: 9px !important;
border-radius: 4px;
outline: none;
transition: background-color 0.2s, color 0.2s;
&:hover {
background-color: rgb(0 0 0 / 6%);
}
}
}
/* 全局覆盖element-plus的el-dialog、el-drawer、el-message-box、el-notification组件右上角关闭图标的样式,表现更鲜明 */
.el-dialog__headerbtn,
.el-message-box__headerbtn {
&:hover {
.el-dialog__close {
color: var(--el-color-info) !important;
}
}
}
\ No newline at end of file
@use './element-plus.scss';
body {
padding: 0;
margin: 0;
// color: #3f3e3b;
// background-color: #ffffff;
// font-family: "华文楷体", "黑体", "Microsoft YaHei", sans-serif;
}
.flex {
display: flex;
justify-content: center;
align-items: center;
}
\ No newline at end of file
// 网站主题色
$primaryColor: #525288;
$successColor: #67c23a;
$dangerColor: #f56c6c;
$warningColor: #e6a23c;
$errorColor: #f56c6c;
$infoColor: #909399;
\ No newline at end of file
<template>
<div>
home
<el-button type="primary">aa</el-button>
</div>
</template>
<script setup lang="ts">
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
{
"files": [],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"
}
]
}
{
"extends": "@tsconfig/node20/tsconfig.json",
"include": [
"vite.config.*",
"vitest.config.*",
"cypress.config.*",
"nightwatch.conf.*",
"playwright.config.*"
],
"compilerOptions": {
"composite": true,
"noEmit": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["node"]
}
}
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment