diff --git a/examples/routers/anchor.vue b/examples/routers/anchor.vue index e53f2941..f99e3fbc 100644 --- a/examples/routers/anchor.vue +++ b/examples/routers/anchor.vue @@ -7,6 +7,7 @@ + @@ -32,6 +33,8 @@ +

李氏专跳

+

这是信息司大是大非胜多负少的{{i}}

@@ -58,6 +61,8 @@

这是新添加的哦哦哦哦哦 哦

这是信息司大是大非胜多负少的{{i}}

+

李氏专跳

+

这是信息司大是大非胜多负少的{{i}}

diff --git a/src/components/anchor/anchor-link.vue b/src/components/anchor/anchor-link.vue index 4b480209..999609db 100644 --- a/src/components/anchor/anchor-link.vue +++ b/src/components/anchor/anchor-link.vue @@ -32,7 +32,14 @@ export default { }, methods: { goAnchor () { - this.anchorCom.turnTo(this.href); + this.currentLink = this.href; + this.anchorCom.$emit('on-select', this.href); + const isRoute = this.$router; + if (isRoute) { + this.$router.push(this.href); + } else { + window.location.href = this.href; + } } }, mounted () { diff --git a/src/components/anchor/anchor.vue b/src/components/anchor/anchor.vue index 0e273d20..52072ad2 100644 --- a/src/components/anchor/anchor.vue +++ b/src/components/anchor/anchor.vue @@ -11,7 +11,7 @@