From a165f3223e9362e5cececdc963dab30e8ca8e657 Mon Sep 17 00:00:00 2001 From: Tevin <tingquanren@163.com> Date: Fri, 07 Mar 2025 13:01:10 +0800 Subject: [PATCH] 知识库文档,改写控制层基类主要方法列表 --- layout/alert/CAlert.vue | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/layout/alert/CAlert.vue b/layout/alert/CAlert.vue index b92feec..93b14f2 100644 --- a/layout/alert/CAlert.vue +++ b/layout/alert/CAlert.vue @@ -13,6 +13,11 @@ <AtModalHeader v-if="title">{{title}}</AtModalHeader> <AtModalContent> {{content}} + <view + v-for="(cont,index) of contents" + :key="index" + style="padding-bottom:6px" + >{{cont}}</view> </AtModalContent> <AtModalAction> <button @tap="evt => handleClose()">{{mode==='alert'?'知道了':'取消'}}</button> @@ -46,41 +51,51 @@ isOpened: false, title: '', content: '', + contents: [], + callback: null, }; }, methods: { handleClose() { this.isOpened = false; + if (this.mode === 'alert') { + this.callback && this.callback(); + } }, handleConfirm() { this.isOpened = false; this.onConfirm && this.onConfirm(); + this.callback && this.callback(); }, - $alert(option) { + $alert(option, callback) { if (!option) { return; } this.mode = 'alert'; + this.callback = callback; if (typeof option === 'string') { this.title = ''; this.content = option; } else if (Tools.isObject(option)) { this.title = option.title; this.content = option.content; + this.contents = option.contents; } this.isOpened = true; }, - $confirm(option) { + $confirm(option, callback) { if (!option) { return; } this.mode = 'comfirm'; + this.callback = callback; if (typeof option === 'string') { this.title = ''; this.content = option; } else if (Tools.isObject(option)) { this.title = option.title; this.content = option.content; + this.contents = option.contents; } this.isOpened = true; }, -- Gitblit v1.9.1