Compare commits

..

No commits in common. '61219dd88e91116221a05adce654cad6203aedbf' and '8f9bf5ff9937c1920b62a1c5c3de013610b8c391' have entirely different histories.

@ -1 +0,0 @@
APP_TITLE=DEMO

@ -1 +0,0 @@
APP_FLAG=dev

@ -1 +0,0 @@
APP_FLAG=prod

@ -1 +0,0 @@
APP_FLAG=staging

@ -1,2 +0,0 @@
assets
mock

@ -1,31 +0,0 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:vue/essential",
"airbnb-base"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"vue"
],
"rules": {
"semi": [2, "never"],
"comma-dangle": 0,
"no-console": 0,
"quotes": [2, "single"],
"no-undef": 0,
"no-debugger": 0,
"import/no-unresolved": 0,
"import/extensions": 0,
"no-param-reassign": 0,
"vue/multi-word-component-names": 0,
"vue/no-multiple-template-root": 0,
"import/no-extraneous-dependencies": 0
}
}

24
.gitignore vendored

@ -1,24 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

@ -1 +0,0 @@
try to run `chmod +x ./.husky/pre-commit` if pre-commit doesn't work.

@ -1 +0,0 @@
npx eslint ./src --ext .js,.vue

@ -1,49 +1,2 @@
<<<<<<< HEAD
# view-ui-project-vite
This project build for Vue3, Vue-router, Vuex, ViewUIPlus and Vite.
## Install
```shell
npm install
```
## Run
```shell
npm run serve
```
## Build
### Build for Production
```shell
npm run build
```
### Build for Staging
```shell
npm run build:staging
```
## Preview
### Preview for Production
```shell
npm run preview
```
### Preview for Staging
```shell
npm run preview:staging
```
## Run Eslint
### Run without Fixing
- This operation will also run before git-commit.
```shell
npm run lint
```
### Run with Fixing
```shell
npm run lint:fix
```
## .env Description
- This project exposes environment variables on `import.meta.env` object.
- Different modes (development/staging/production) correspond to different environment files (.env.*).
- .env file is always included, duplicate variables are overwritten by the specific mode file (.env.*).
=======
# jty # jty
>>>>>>> 8f9bf5ff9937c1920b62a1c5c3de013610b8c391

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="shortcut icon" href="https://file.iviewui.com/file/iview-design-favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%- APP_TITLE %></title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 KiB

7702
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,44 +0,0 @@
{
"name": "view-ui-project-vite",
"version": "1.0.0",
"description": "a template project for vue3, vue-router, vuex, ViewUIPlus and vite.",
"scripts": {
"serve": "npm run dev",
"dev": "vite serve",
"build": "vite build",
"build:staging": "vite build --mode=staging",
"preview": "npm run build && vite preview",
"preview:staging": "npm run build:staging && vite preview --mode=staging",
"lint": "eslint ./src --ext .js,.vue",
"lint:fix": "eslint ./src --ext .js,.vue --fix",
"prepare": "husky install"
},
"dependencies": {
"axios": "^0.27.0",
"view-ui-plus": "^1.3.0",
"vue": "^3.2.25",
"vue-router": "^4.0.14",
"vuex": "^4.0.2"
},
"devDependencies": {
"@vitejs/plugin-vue": "^2.3.1",
"autoprefixer": "^10.4.5",
"eslint": "^8.14.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-vue": "^8.7.1",
"husky": "^7.0.4",
"less": "^4.0.0",
"less-loader": "^10.2.0",
"mockjs": "^1.1.0",
"vite": "^2.9.18",
"vite-plugin-html": "^3.2.0"
},
"engines": {
"node": ">= 12.0.0",
"npm": ">= 6.9.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

@ -1,19 +0,0 @@
<template>
<div id="app">
<MyComponent />
</div>
</template>
<script>
import MyComponent from './components/MainPage.vue';
export default {
components: {
MyComponent
}
};
</script>
<style>
/* 你可以在这里添加全局样式 */
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

@ -1,93 +0,0 @@
<template>
<div class="gradient-1">
<transition name="fade">
<div class="container">
<div class="demo-login">
<Login @on-submit="handleSubmit">
<h3>用户登录</h3>
<br>
<UserName name="username" />
<Password name="password" />
<div class="demo-auto-login">
<Checkbox v-model="autoLogin" size="large"></Checkbox>
<a>忘记密码</a>
</div>
<Submit/>
<br>
<a href="" class="another">换种方式登录</a>
</Login>
</div>
</div>
</transition>
</div>
</template>
<script setup>
const autoLogin = true;
const anim = 0;
async function handleSubmit(valid, {username, password}){
if (valid) {
const user = {
name : $this.username,
password : $this.password
}
const res = await axios.post('https://localhost:8080/Login',user)
.then(response => {
//
})
.catch(error => {
//
this.$Message.info('error');
})
console.log(res);
}
};
</script>
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
position: relative;
}
.gradient-1 {
width: 100%;
height: 100vh;
position: relative;
background: linear-gradient(45deg, #FFBBFF, #FFD7BE);
}
.container{
height: 400px;
width: 300px;
border: pink solid 1px;
border-radius: 10px;
background-color: white;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.demo-login{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 250px;
}
.demo-auto-login{
margin-bottom: 24px;
text-align: left;
}
.demo-auto-login a{
float: right;
}
h3{
color: #2d8cf0;
}
</style>

@ -1,74 +0,0 @@
<template>
<div class="gradient-1">
<div class="headArea">
<div class="haBody">
<div class="haBody-1">
<h1>
<a href="" class="logo">
<img src="../logo1.png" alt="">
</a>
</h1>
</div>
<div class="haBody-2"></div>
<div class="haBody-3"></div>
<div class="haBody-4"></div>
</div>
</div>
</div>
</template>
<script>
</script>
<style>
.gradient-1 {
width: 100%;
height: 100vh;
position: relative;
background: linear-gradient(45deg, #FFBBFF, #FFD7BE);
}
.headArea {
height: 50px;
width: 100%;
background-color: white;
display: flex; /* 使用 Flexbox 布局 */
justify-content: center; /* 水平居中 */
align-items: center; /* 垂直居中 */
}
.haBody{
display: flex;
width: 75%;
height: 100%;
background-color: lightblue;
}
.haBody-1{
display: flex;
background-image: url();
width: 100px;
height: 50px;
background-color: green;
}
.haBody-2{
display: flex;
width: 100px;
height: 50px;
background-color: blue;
}
.haBody-3{
display: flex;
width: 100px;
height: 50px;
background-color: red;
}
.haBody-4{
display: flex;
width: 100px;
height: 50px;
background-color: yellow;
}
.logo{
text-decoration: none;
}
</style>

@ -1,32 +0,0 @@
<template>
<div class="demo-login">
<Login @on-submit="handleSubmit">
<Mobile name="mobile" />
<Captcha name="captcha" :field="['mobile']" @on-get-captcha="handleGetCaptcha" />
<Submit />
</Login>
</div>
</template>
<script>
export default {
methods: {
handleSubmit (valid, { mobile, captcha }) {
if (valid) {
this.$Modal.info({
title: '输入的内容如下:',
content: 'mobile: ' + mobile + ' | captcha: ' + captcha
});
}
},
handleGetCaptcha () {
this.$Message.info('获取验证码');
}
}
}
</script>
<style>
.demo-login{
width: 400px !important;
margin: 0 auto;
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@ -1,14 +0,0 @@
import { createApp } from 'vue'
import ViewUIPlus from 'view-ui-plus'
import App from './App.vue'
import router from './router'
import store from './store'
import './styles/index.less'
// import './mock'
const app = createApp(App)
app.use(router)
.use(store)
.use(ViewUIPlus)
.mount('#app')

@ -1,6 +0,0 @@
import Mock from 'mockjs'
import './user'
Mock.setup({ timeout: 300 })
export default Mock

@ -1,11 +0,0 @@
import Mock from 'mockjs'
Mock.mock(/\/userList/, 'get', {
code: 200,
data: [
{
id: '@id',
name: '@name'
}
]
})

@ -1,20 +0,0 @@
import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
const routes = [
{
path: '/',
name: 'home',
component: Home
}
]
const router = createRouter({
routes,
history: createWebHistory(),
scrollBehavior() {
return { top: 0 }
}
})
export default router

@ -1,8 +0,0 @@
import { createStore } from 'vuex'
export default createStore({
state: {},
mutations: {},
actions: {},
modules: {}
})

@ -1,3 +0,0 @@
@import '~view-ui-plus/src/styles/index.less';
//@primary-color: #8c0776;

@ -1 +0,0 @@
@font-size: 16px;

@ -1,21 +0,0 @@
<template>
<Demo/>
</template>
<script>
import Login from '@/components/Login.vue'
export default {
name: 'Home',
components: {
Login
},
setup() {
},
methods: {
}
}
</script>
<style lang="less" scoped>
</style>

@ -1,75 +0,0 @@
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import autoprefixer from 'autoprefixer'
import { createHtmlPlugin } from 'vite-plugin-html'
import path from 'path'
const config = ({ mode }) => {
const isProd = mode === 'production'
const envPrefix = 'APP_'
const { APP_TITLE = '' } = loadEnv(mode, process.cwd(), envPrefix)
return {
plugins: [
vue(),
createHtmlPlugin({
minify: isProd,
inject: {
data: {
title: APP_TITLE,
},
}
})
],
build: {
target: 'es2015',
outDir: path.resolve(__dirname, 'dist'),
assetsDir: 'assets',
assetsInlineLimit: 8192,
sourcemap: !isProd,
emptyOutDir: true,
rollupOptions: {
input: path.resolve(__dirname, 'index.html'),
output: {
chunkFileNames: 'js/[name].[hash].js',
entryFileNames: 'js/[name].[hash].js',
// assetFileNames: "assets/[name].[hash].[ext]",
}
}
},
envPrefix,
resolve: {
alias: [
{ find: /^@\//, replacement: `${path.resolve(__dirname, 'src')}/` },
{ find: /^~/, replacement: '' }
],
extensions: ['.js', '.mjs', '.vue', '.json', '.less', '.css']
},
css: {
postcss: {
plugins: [
autoprefixer
],
},
preprocessorOptions: {
less: {
javascriptEnabled: true,
additionalData: `@import "${path.resolve(__dirname, 'src/styles/variable.less')}";`
}
}
},
server: {
open: true,
proxy: {
'/api': {
target: 'http://localhost:8080',
changeOrigin: true
}
}
},
preview: {
port: 5000
}
}
}
export default defineConfig(config)
Loading…
Cancel
Save