浏览代码

toast样式优化

任一存 2 年之前
父节点
当前提交
f873edef32
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 二进制
      src/assets/images/toast-check-bg.png
  2. 6 6
      src/utils.js

二进制
src/assets/images/toast-check-bg.png


+ 6 - 6
src/utils.js

@@ -126,15 +126,15 @@ export default {
     toastNode.style.transform = 'translate(-50%, -50%)'
     toastNode.style.backgroundColor = '#555'
     toastNode.style.borderRadius = '0.5rem'
-    toastNode.style.padding = '1.67rem'
-    toastNode.style.minWidth = '33vw'
+    toastNode.style.padding = '9.75rem 1.67rem 1.67rem 1.67rem'
+    toastNode.style.width = '16.67rem'
+    toastNode.style.height = '16.67rem'
     toastNode.style.color = '#fff'
     toastNode.style.fontSize = '1.67rem'
     toastNode.style.zIndex = globalConfig.zIndex.toast.self
-    toastNode.style.display = 'flex'
-    toastNode.style.flexDirection = 'column'
-    toastNode.style.justifyContent = 'center'
-    toastNode.style.alignItems = 'center'
+    toastNode.style.textAlign = 'center'
+    toastNode.style.backgroundImage = `url(${require('@/assets/images/toast-check-bg.png')})`
+    toastNode.style.backgroundSize = 'contain'
     toastNode.innerText = contentStr
     document.body.appendChild(toastNode)
     setTimeout(() => {