|
|
@ -10,8 +10,6 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import pathToRegexp from 'path-to-regexp' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
@ -49,18 +47,13 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
return name.trim() === '首页' |
|
|
|
return name.trim() === '首页' |
|
|
|
}, |
|
|
|
}, |
|
|
|
pathCompile(path) { |
|
|
|
|
|
|
|
const { params } = this.$route |
|
|
|
|
|
|
|
var toPath = pathToRegexp.compile(path) |
|
|
|
|
|
|
|
return toPath(params) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleLink(item) { |
|
|
|
handleLink(item) { |
|
|
|
const { redirect, path } = item |
|
|
|
const { redirect, path } = item |
|
|
|
if (redirect) { |
|
|
|
if (redirect) { |
|
|
|
this.$router.push(redirect) |
|
|
|
this.$router.push(redirect) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
this.$router.push(this.pathCompile(path)) |
|
|
|
this.$router.push(path) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|