提交 6aa4d919 编写于 作者: D Daniel Castillo 提交者: ULIVZ

fix($medium-zoom): not updating on component update (#994)

* ️ upgrade to medium-zoom@1.0.2

* 🐛 fix medium-zoom not updating on component update

* ️ downgrade to medium-zoom@0.4.0 to fix serverside rendering bug

* 👌 use arrow function 'this' and outsource updateZoom to function
上级 ecb1920a
......@@ -4,9 +4,24 @@ import './style.css'
import zoom from 'medium-zoom'
export default {
data: () => ({ zoom: null }),
mounted () {
setTimeout(() => {
zoom(SELECTOR)
}, 1000)
this.updateZoom()
},
updated () {
this.updateZoom()
},
methods: {
updateZoom () {
setTimeout(() => {
if (this.zoom) {
this.zoom.detach()
}
this.zoom = zoom(SELECTOR)
}, 1000)
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册