package.jsonvue
{
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"echarts": "^4.2.1",
"element-ui": "^2.4.11",
"js-cookie": "~2.2.0",
"nuxt": "2.4.0",
"qs": "^6.6.0",
"vue-awesome-swiper": "^3.1.3",
}
}
複製代碼
如上是一個package.json的簡單示例。element-ui
平時咱們是否注意過json
"echarts": "^4.2.1"
這裏的^
號,"js-cookie": "~2.2.0"
這裏的~
號,"nuxt": "2.4.0"
這種什麼符號都沒有的狀況都表示什麼意思?一個小知識點卻讓我困惑了好久(大神能夠繞道)bash
^
: 表示升級到中間版本號版本的最新版,好比"echarts": "^4.2.1"
可能會升到如"echarts": "^4.8.1"
~
: 表示升級到最後一位版本號的最新版,好比"js-cookie": "~2.2.0"
可能會升到 "js-cookie": "~2.2.8"