src/plugins/modal.ts
@@ -14,9 +14,22 @@ * @param content 消息内容 */ msgError(content: string): void { const text = (content ?? '').toString() // showToast 在多端经常会对 title 做单行/长度截断;长文案用 showModal 保证完整展示 const shouldUseModal = text.length > 16 || text.includes('\n') if (shouldUseModal) { uni.showModal({ title: '错误', content: text, showCancel: false, confirmText: '知道了', }) return } uni.showToast({ title: content, icon: 'error' title: text, icon: 'none', duration: 2500, }) }, /**