get real version from node_modules

This commit is contained in:
lvsmart 2017-12-08 11:21:40 +08:00
parent a9d2978c31
commit 1d64f32774
2 changed files with 1 additions and 8 deletions

View File

@ -6,9 +6,8 @@
</template>
<script>
import { getVersion } from '@/utils/index.js'
const version = getVersion('element-ui') // element-ui version from package.json
const version = require('element-ui/package.json').version // element-ui version from node_modules
const ORIGINAL_THEME = '#409EFF' // default color
export default {

View File

@ -265,9 +265,3 @@ export function deepClone(source) {
}
return targetObj
}
// get dependencies verison from package.json
export function getVersion(name) {
const p = require('../../package')
return p.dependencies[name]
}