gm-printer 10.36.2 → 10.36.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/demo.js +1 -1
- package/package.json +1 -1
- package/src/components/tip/index.js +10 -2
package/package.json
CHANGED
|
@@ -38,12 +38,20 @@ function getTipDOM(id) {
|
|
|
38
38
|
Tip.warning = (message = '') => {
|
|
39
39
|
tips.push(message)
|
|
40
40
|
|
|
41
|
+
const tipDOM = getTipDOM('gm-printer-tip')
|
|
42
|
+
if (!tipDOM) {
|
|
43
|
+
// 打印 iframe 场景下不存在 gm-printer-tip 容器,用 alert 兜底
|
|
44
|
+
window.alert(message)
|
|
45
|
+
tips.pop()
|
|
46
|
+
return
|
|
47
|
+
}
|
|
48
|
+
|
|
41
49
|
setTimeout(() => {
|
|
42
50
|
tips.shift()
|
|
43
|
-
ReactDOM.render(<Tip list={tips} />,
|
|
51
|
+
ReactDOM.render(<Tip list={tips} />, tipDOM)
|
|
44
52
|
}, 3000)
|
|
45
53
|
|
|
46
|
-
ReactDOM.render(<Tip list={tips} />,
|
|
54
|
+
ReactDOM.render(<Tip list={tips} />, tipDOM)
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
Tip.propTypes = {
|