修复on-select事件不触发
This commit is contained in:
zhigang.li 2018-06-29 18:25:41 +08:00
parent 9d553a2b81
commit 7ff2f71a2f
2 changed files with 11 additions and 9 deletions

View file

@ -5,11 +5,9 @@
</div>
</template>
<script>
import mixinsLink from '../../mixins/link';
export default {
name: 'AnchorLink',
inject: ['anchorCom'],
mixins: [ mixinsLink ],
props: {
href: String,
title: String
@ -33,10 +31,15 @@ export default {
}
},
methods: {
goAnchor (event) {
goAnchor () {
this.currentLink = this.href;
this.$emit('on-select', this.href);
this.handleCheckClick(event);
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 () {