xiaochan 1 рік тому
батько
коміт
364e933075

+ 4 - 3
src/components/xiao-chan/cy-message-box/cy-message-box.ts

@@ -22,7 +22,8 @@ interface CyMessageBox {
     inputRows?: number,
     boxId?: string,
     allowToBeEmpty?: boolean,
-    dangerouslyUseHTMLString?: boolean
+    dangerouslyUseHTMLString?: boolean,
+    title?: string
 }
 
 export function getCyId(): string {
@@ -85,8 +86,8 @@ function renderFunc(message: string, type: 'success' | 'error' | 'warning' | 'in
         const data: CyMessageBox = {
             message,
             inputRows: config && config.inputRows || 0,
-            confirmClick: () => {
-                resolve('confirm')
+            confirmClick: (val) => {
+                resolve(val)
                 closeBox()
             },
             cancel: (val: string) => {

+ 3 - 2
src/components/xiao-chan/cy-message-box/index.vue

@@ -30,7 +30,8 @@ const props = withDefaults(defineProps<{
   inputRows?: number,
   boxId?: string,
   allowToBeEmpty?: boolean,
-  dangerouslyUseHTMLString?: boolean
+  dangerouslyUseHTMLString?: boolean,
+  title?: string
 }>(), {
   showCancel: true,
   confirmButtonText: '确认',
@@ -216,7 +217,7 @@ function close() {
                 :type="props.inputRows === 0 ? '' : 'textarea'"
                 :minlength="props.inputMinLength"
                 :maxlength="props.inputMaxLength"
-                show-word-limit
+                :show-word-limit="true"
                 :id="inputId"
                 v-model.trim="inputValue"/>
           </div>