Skip to main content

· One min read

Tech Stack

1. React18
2. Next14
3. Tailwindcss
4. Ant Design
5. Alibaba Cloud

Introduction

Elevator Management Platform, including a platform end, an enterprise end, and a maintenance personnel end. After the enterprise registration, the elevator maintenance needs are released at the enterprise end. The platform end is responsible for enterprise registration review and order dispatch circulation. Maintenance personnel receive orders through the mobile app.

Presentation

  • Locale Dropdown
  • Locale Dropdown

Demo

· One min read

Tech Stack

1. Vue3
2. Vuex
3. ElementUI
4. scss
5. Java
6. Spring

Introduction

a comprehensive solution designed to streamline the management of chemical reagents, lab equipment, and material borrowing records. Key features include automatic inventory tracking, borrowing history, risk reporting, and stock management, providing a powerful tool for optimized and efficient laboratory operations.

Presentation

  • Locale Dropdown

Demo

· One min read

Tech Stack

1. Vue2
2. Vuex
3. uview
4. scss
5. uniapp
6. Java
7. Spring

Introduction

a comprehensive solution designed to streamline the management of chemical reagents, lab equipment, and material borrowing records. Key features include automatic inventory tracking, borrowing history, risk reporting, and stock management, providing a powerful tool for optimized and efficient laboratory operations.

Presentation

Demo

· One min read

Tech Stack

1. Vue2
2. Vuex
3. uview
4. scss
5. uniapp

Introduction

an HTML5 mobile solution for managing solar facilities. Key features include real-time monitoring, analytics, alerts, and recommendations to maximize efficiency and minimize downtime, driving success in renewable energy management.

Presentation

Demo

  • shutdown and doesn't exit

· One min read

Tech Stack

1. Vue2
2. Vuex
3. scss
4. ElementUI

Introduction

Unified management of supplier SKU, integrating product purchasing and expense reimbursement processes, enabling university professors to select teaching-related products from designated supplier SKUs without needing to apply for reimbursement for each purchase.

Presentation

Demo

· 2 min read

项目根src目录建立store文件

  • /src/store/index
import { createStore } from 'vuex' // 导入
import { toRaw } from 'vue' // 这里是比较迷惑的,vue3需要用到;但是既然是vue3了为什么不用pinia

const store = createStore({
state: {
myState: '' // 定义一个state变量,也可以是对象类型
},
mutations: {
setMyState: (state, payload) => {
state.myState = payload.value
}
},
// 可以不添加action,但是action结合dispatch使用是异步调用
actions: {
handlerMyState: (context, payload) => {
context.commit('setMyState', payload)
}
},
getters: {
getMyState: (state) => {
return toRaw(state.myState) // 如果是vue3返回的会是proxy,需要用toRaw解构一下拿到真实的值
}
}
})

export default store

main.js中配置

vue3版本
import { createApp } from 'vue'
import App from './App.vue'
import store from './store' // 导入/src/store/index.js
const app = createApp(App)
app.use(store) // 挂载
app.mount('#app')
vue2版本
import Vue from 'vue'
import App from './App.vue'
import store from './store'
new Vue({
store, // 一点小差别
render: h => h(App),
}).$mount('#app')

vue文件中使用

vue3
{/* <script setup> */}
import { useStore } from 'vuex'
const store = useStore()
// 同步调用,setMyState是mutations中的方法名
store.commit("setMyState", { value: 'my value' })
// 异步dispatch修改值,handlerMyState是action中的方法名
store.dispatch('handlerMyState', { value: 'my value' })
// </script>

<span>{{store.getters['getMyState']}}</span>
vue2
this.$store.state.myState
<span>{{$store.state.myState}}</span>

· 2 min read

一、通过mkcert创建本地证书并加载

  1. 安装mkcert
  npm install -g mkcert
  1. 生成证书
  mkcert create-ca
mkcert create-cert

生成了四个文件

  ca.crt
ca.key
cert.crt
cert.key

加载证书

mac

  • 双击ca.cert,在弹出的界面选择Test CA,选择“信任”,然后选择“始终信任”,最后输入密 码确认即可

windows

  • 双击ca.crt,在弹出的界面中选择安装证书,选择“当前用户”或“本地计算机”均可,关键的是下一步,选择“将所有的证书都放入下列存储”,并且选择为“受信任的根证书颁发机构”,然后一路确定即可

二、在vue或uniapp中使用刚刚的证书

  1. vue2
// vue.config.js
const path = require('path')
const fs = require('fs')
module.exports = {
devServer: {
open: true,
https: {
cert: fs.readFileSync(path.join(__dirname, 'src/ssl/cert.crt')),
key: fs.readFileSync(path.join(__dirname, 'src/ssl/cert.key'))
}
}
}

  1. vue3
// vite.config.js
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const fs = require('fs')
const path = require('path')
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.join(__dirname, 'src')
}
},
server: {
open: true,
https: {
// 主要是下面两行的配置文件,不要忘记引入 fs 和 path 两个对象
cert: fs.readFileSync(path.join(__dirname, 'src/ssl/cert.crt')),
key: fs.readFileSync(path.join(__dirname, 'src/ssl/cert.key'))
}
}
})
  1. uniapp
// manifest.json
"h5" : {
"devServer" : {
"https" : {
"cert" : "复制cert.cer中的全部内容,换行转换为\n"
"key" : "复制cert.key中的全部内容,换行转换为\n"
},
"proxy" : {} // 这个必须在这里配置,因为vue.config.js中的会冲突
},
"async" : {
"delay" : "10000"
},
"router" : {
"base" : "./"
}
}