fix: fix style

This commit is contained in:
jiangruowei 2017-03-15 20:31:08 +08:00
parent c515965358
commit 2baef3a62b
2 changed files with 4 additions and 5 deletions

View File

@ -3,9 +3,9 @@ import Vue from 'vue';
const ToastConstructor = Vue.extend(require('./toast.vue')); const ToastConstructor = Vue.extend(require('./toast.vue'));
let toastQueue = []; let toastQueue = [];
let getInstance = () => { const getInstance = () => {
if (toastQueue.length > 0) { if (toastQueue.length > 0) {
let instance = toastQueue[0]; const instance = toastQueue[0];
toastQueue.splice(0, 1); toastQueue.splice(0, 1);
return instance; return instance;
} }
@ -26,7 +26,6 @@ const removeDom = event => {
} }
}; };
var Toast = (options = {}) => { var Toast = (options = {}) => {
const duration = options.duration || 3000; const duration = options.duration || 3000;
@ -41,7 +40,6 @@ var Toast = (options = {}) => {
Vue.nextTick(function() { Vue.nextTick(function() {
instance.visible = true; instance.visible = true;
instance.$el.removeEventListener('transitionend', removeDom); instance.$el.removeEventListener('transitionend', removeDom);
instance.timer = setTimeout(function() { instance.timer = setTimeout(function() {
if (instance.closed) return; if (instance.closed) return;
instance.visible = false; instance.visible = false;

View File

@ -3,9 +3,10 @@
@component-namespace zan { @component-namespace zan {
@b toast { @b toast {
position: fixed; position: fixed;
z-index: 3000;
border-radius: 5px; border-radius: 5px;
background-color: #272727; background-color: #272727;
opacity: 0.7; opacity: .7;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate3d(-50%, -50%, 0); transform: translate3d(-50%, -50%, 0);