移除path-to-regexp正则匹配插件
This commit is contained in:
@ -10,8 +10,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pathToRegexp from 'path-to-regexp'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -49,18 +47,13 @@ export default {
|
||||
}
|
||||
return name.trim() === '首页'
|
||||
},
|
||||
pathCompile(path) {
|
||||
const { params } = this.$route
|
||||
var toPath = pathToRegexp.compile(path)
|
||||
return toPath(params)
|
||||
},
|
||||
handleLink(item) {
|
||||
const { redirect, path } = item
|
||||
if (redirect) {
|
||||
this.$router.push(redirect)
|
||||
return
|
||||
}
|
||||
this.$router.push(this.pathCompile(path))
|
||||
this.$router.push(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user