Quellcode durchsuchen

fix: Cannot read property 'compile' of undefined

MoonBegonia vor 5 Jahren
Ursprung
Commit
4d02e9e593
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      src/components/Breadcrumb/index.vue

+ 2 - 2
src/components/Breadcrumb/index.vue

@@ -10,7 +10,7 @@
 </template>
 
 <script>
-import pathToRegexp from 'path-to-regexp'
+import { compile } from 'path-to-regexp'
 
 export default {
   data() {
@@ -52,7 +52,7 @@ 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)
+      var toPath = compile(path)
       return toPath(params)
     },
     handleLink(item) {