feat: Update all packages to latest version.

This commit is contained in:
EdwinBetanc0urt
2020-08-26 17:25:01 -04:00
parent 5e7113935c
commit cb936b3a94
9 changed files with 78 additions and 62 deletions

View File

@@ -10,7 +10,7 @@
</template>
<script>
import pathToRegexp from 'path-to-regexp'
import { compile } from 'path-to-regexp'
export default {
data() {
@@ -52,16 +52,16 @@ export default {
pathCompile(path) {
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
const { params } = this.$route
var toPath = pathToRegexp.compile(path)
const toPath = compile(path)
return toPath(params)
},
handleLink(item) {
const { redirect, path } = item
if (redirect) {
this.$router.push(redirect)
this.$router.push(redirect, () => {})
return
}
this.$router.push(this.pathCompile(path))
this.$router.push(this.pathCompile(path), () => {})
}
}
}

View File

@@ -12,7 +12,12 @@
class="header-search-select"
@change="change"
>
<el-option v-for="item in options" :key="item.path" :value="item" :label="item.title.join(' > ')" />
<el-option
v-for="element in options"
:key="element.item.path"
:value="element.item.path"
:label="element.item.title.join(' > ')"
/>
</el-select>
</div>
</template>
@@ -69,8 +74,8 @@ export default {
this.options = []
this.show = false
},
change(val) {
this.$router.push(val.path)
change(path) {
this.$router.push(path, () => {})
this.search = ''
this.options = []
this.$nextTick(() => {

View File

@@ -76,7 +76,7 @@ export default {
},
async logout() {
await this.$store.dispatch('user/logout')
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
this.$router.push(`/login?redirect=${this.$route.fullPath}`, () => {})
}
}
}

View File

@@ -142,7 +142,7 @@ export default {
})
},
closeOthersTags() {
this.$router.push(this.selectedTag)
this.$router.push(this.selectedTag, () => {})
this.$store.dispatch('tagsView/delOthersViews', this.selectedTag).then(() => {
this.moveToCurrentTag()
})
@@ -158,15 +158,17 @@ export default {
toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0]
if (latestView) {
this.$router.push(latestView.fullPath)
this.$router.push(latestView.fullPath, () => {})
} else {
// now the default is to redirect to the home page if there is no tags-view,
// you can adjust it according to your needs.
if (view.name === 'Dashboard') {
// to reload home page
this.$router.replace({ path: '/redirect' + view.fullPath })
this.$router.replace({
path: '/redirect' + view.fullPath
}, () => {})
} else {
this.$router.push('/')
this.$router.push('/', () => {})
}
}
},

View File

@@ -49,7 +49,9 @@ export default {
methods: {
back() {
if (this.$route.query.noGoBack) {
this.$router.push({ path: '/dashboard' })
this.$router.push({
path: '/dashboard'
}, () => {})
} else {
this.$router.go(-1)
}

View File

@@ -158,7 +158,10 @@ export default {
this.loading = true
this.$store.dispatch('user/login', this.loginForm)
.then(() => {
this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
this.$router.push({
path: this.redirect || '/',
query: this.otherQuery
}, () => {})
this.loading = false
})
.catch(() => {
@@ -189,7 +192,9 @@ export default {
// const codeName = code[type]
// if (codeName) {
// this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
// this.$router.push({ path: this.redirect || '/' })
// this.$router.push({
// path: this.redirect || '/'
// }, () => {})
// })
// } else {
// alert('第三方登录失败')

View File

@@ -12,7 +12,9 @@ export default {
components: { SwitchRoles },
methods: {
handleRolesChange() {
this.$router.push({ path: '/permission/index?' + +new Date() })
this.$router.push({
path: '/permission/index?' + +new Date()
}, () => {})
}
}
}

View File

@@ -32,7 +32,7 @@ export default {
},
watch: {
activeName(val) {
this.$router.push(`${this.$route.path}?tab=${val}`)
this.$router.push(`${this.$route.path}?tab=${val}`, () => {})
}
},
created() {