From ae5a5878d5bd1f8e5e436d45e6653eca7662d6da Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Fri, 6 Sep 2019 19:01:49 +0800 Subject: [PATCH] cr anchor & avatar --- components/anchor/AnchorLink.jsx | 6 ++++-- components/avatar/Avatar.jsx | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/components/anchor/AnchorLink.jsx b/components/anchor/AnchorLink.jsx index 6410a2a28..f1e3836fa 100644 --- a/components/anchor/AnchorLink.jsx +++ b/components/anchor/AnchorLink.jsx @@ -21,8 +21,10 @@ export default { }, watch: { href(val, oldVal) { - this.antAnchor.unregisterLink(oldVal); - this.antAnchor.registerLink(val); + this.$nextTick(() => { + this.antAnchor.unregisterLink(oldVal); + this.antAnchor.registerLink(val); + }); }, }, diff --git a/components/avatar/Avatar.jsx b/components/avatar/Avatar.jsx index e02abe4d8..a40aa1aa5 100644 --- a/components/avatar/Avatar.jsx +++ b/components/avatar/Avatar.jsx @@ -6,7 +6,7 @@ export default { props: { prefixCls: { type: String, - default: 'ant-avatar', + default: undefined, }, shape: { validator: val => ['circle', 'square'].includes(val), @@ -36,8 +36,12 @@ export default { }, watch: { src() { - this.isImgExist = true; - this.scale = 1; + this.$nextTick(() => { + this.isImgExist = true; + this.scale = 1; + // force uodate for position + this.$forceUpdate(); + }); }, }, mounted() {