mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-03-14 03:40:36 +08:00
前端显示的版本号用package.json里的
This commit is contained in:
parent
36345c37ab
commit
8eff63e17b
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "blivechat",
|
||||
"version": "0.1.0",
|
||||
"version": "v1.6.0-beta",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
@ -27,20 +27,6 @@
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"vue-template-compiler": "^2.5.21"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/essential",
|
||||
"eslint:recommended"
|
||||
],
|
||||
"rules": {},
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint"
|
||||
}
|
||||
},
|
||||
"postcss": {
|
||||
"plugins": {
|
||||
"autoprefixer": {}
|
||||
|
@ -8,9 +8,7 @@
|
||||
<h1 class="sidebar-title">blivechat</h1>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="version">
|
||||
v1.6.0-beta
|
||||
</div>
|
||||
<div class="version">{{ APP_VERSION }}</div>
|
||||
<sidebar></sidebar>
|
||||
</el-aside>
|
||||
<el-main>
|
||||
@ -32,6 +30,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
APP_VERSION: process.env.APP_VERSION,
|
||||
|
||||
isMobile: false,
|
||||
hideSidebar: true
|
||||
}
|
||||
|
13
frontend/vue.config.js
Normal file
13
frontend/vue.config.js
Normal file
@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
chainWebpack: config => {
|
||||
const APP_VERSION = process.env.npm_package_version
|
||||
|
||||
config.plugin('define')
|
||||
.tap(args => {
|
||||
let defineMap = args[0]
|
||||
let env = defineMap['process.env']
|
||||
env['APP_VERSION'] = JSON.stringify(APP_VERSION)
|
||||
return args
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user