Browse Source

docs: dialog

richard1015 4 years ago
parent
commit
3927549d7f
3 changed files with 25 additions and 3 deletions
  1. 1 0
      src/packages/dialog/demo.vue
  2. 23 2
      src/packages/dialog/doc.md
  3. 1 1
      src/packages/dialog/index.vue

+ 1 - 0
src/packages/dialog/demo.vue

@@ -47,6 +47,7 @@ export default createDemo({
       Dialog({
         title: '温馨提示',
         content: '支持函数调用和组件调用两种方式。',
+        noCancelBtn: true,
         onCancel,
         onOk
       });

+ 23 - 2
src/packages/dialog/doc.md

@@ -16,9 +16,30 @@ import { Dialog } from '@nutui/nutui';
 const app = createApp();
 app.use(Dialog);
 ```
-## 标签式写法
 
-如果Dialog内容有复杂交互,可使用Dialog的标签式用法。注意标签使用的时候,属性不建议使用驼峰,推荐使用如下写法
+
+## 函数调用
+
+``` javascript
+Dialog({
+  title: '基础弹框',
+  content: '支持函数调用和组件调用两种方式。'
+});
+
+Dialog({
+  content: '无标题弹框'
+});
+
+Dialog({
+  title: '提示弹框',
+  content: '支持函数调用和组件调用两种方式。',
+  noCancelBtn: true,
+});
+```
+
+
+
+## 标签式组件使用
 
 ```html
 <nut-dialog :title="title" :close-on-click-overlay="false" :content="content" v-model:visible="visible"></nut-dialog>

+ 1 - 1
src/packages/dialog/index.vue

@@ -53,7 +53,7 @@ import { onMounted, computed, watch, ref } from 'vue';
 import { createComponent } from '@/utils/create';
 const { componentName, create } = createComponent('dialog');
 import Popup, { popupProps } from '@/packages/popup/index.vue';
-import { Button } from '@/nutui';
+import { Button, Icon } from '@/nutui';
 export default create({
   inheritAttrs: false,
   children: [Popup, Button],