通过dynamic-imports

This commit is contained in:
MaYuanhai 2019-10-10 11:43:41 +08:00 committed by GitHub
parent 2aa3ff2148
commit 57c43c21c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -72,8 +72,8 @@ export default {
this.searchPool = this.generateRoutes(this.routes)
},
methods: {
addPinyinField(list) {
const pinyin = require('pinyin')
async addPinyinField(list) {
const { default: pinyin } = await import('pinyin')
if (Array.isArray(list)) {
list.forEach(element => {
const title = element.title