From c27e413f71c4beb1318237fedf585770702fe3a4 Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Thu, 13 Mar 2025 10:13:57 +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