diff --git a/package.json b/package.json index b39c798..c25e5f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-notice", - "version": "0.2.0", + "version": "0.2.1", "description": "A notice plug-in for Vue", "main": "script/index.js", "repository": "https://github.com/coolzjy/vue-notice", diff --git a/script/index.js b/script/index.js index 5efe519..53d9908 100644 --- a/script/index.js +++ b/script/index.js @@ -91,10 +91,9 @@ document.body.appendChild(this.div) - // if set opacity sync, the transition will be ignored - setTimeout((function () { - applyStyle(this.div, showStyle) - }).bind(this), 0) + // make sure brower has render style above + window.getComputedStyle(this.div).opacity + applyStyle(this.div, showStyle) setTimeout((function () { applyStyle(this.div, hideStyle)