get real version from node_modules

This commit is contained in:
lvsmart 2017-12-08 11:21:40 +08:00 committed by 花裤衩
parent ebc2ac08b7
commit b7939165d1
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]
}