perf[utils]: optimize code

This commit is contained in:
Pan
2019-02-19 10:07:18 +08:00
parent 48e47e86f1
commit 070a3343f2
4 changed files with 8 additions and 10 deletions

View File

@@ -7,7 +7,7 @@
</template>
<script>
import { isExternal } from '@/utils'
import { isExternal } from '@/utils/validate'
export default {
props: {

View File

@@ -39,7 +39,7 @@
<script>
import path from 'path'
import { generateTitle } from '@/utils/i18n'
import { isExternal } from '@/utils'
import { isExternal } from '@/utils/validate'
import Item from './Item'
import AppLink from './Link'
import FixiOSBug from './FixiOSBug'
@@ -94,14 +94,12 @@ export default {
return false
},
resolvePath(routePath) {
if (this.isExternalLink(routePath)) {
if (isExternal(routePath)) {
return routePath
}
return path.resolve(this.basePath, routePath)
},
isExternalLink(routePath) {
return isExternal(routePath)
},
generateTitle
}
}