浏览代码

fix(picker): popup props feat lock-scroll

richard1015 4 年之前
父节点
当前提交
7cdd87dc4d
共有 2 个文件被更改,包括 8 次插入5 次删除
  1. 3 0
      src/packages/__VUE/picker/doc.md
  2. 5 5
      src/packages/__VUE/picker/index.vue

+ 3 - 0
src/packages/__VUE/picker/doc.md

@@ -166,6 +166,9 @@ export default createDemo({
 | title        | 设置标题                         | String | -                |
 | list-data         | 列表数据 | Array | -                |
 | default-value-index         | 初始选中项的索引,默认为 0 | number | 0                |
+| teleport               | 指定挂载节点                          | String  | "body"   |
+| close-on-click-overlay | 点击蒙层是否关闭对话框                | Boolean | false    |
+| lock-scroll            | 背景是否锁定                          | Boolean | false    |
    
 ### Events
     

+ 5 - 5
src/packages/__VUE/picker/index.vue

@@ -4,6 +4,9 @@
       position="bottom"
       :style="{ height: height + 56 + 'px' }"
       v-model:visible="show"
+      :teleport="teleport"
+      :lock-scroll="lockScroll"
+      :close-on-click-overlay="closeOnClickOverlay"
       @close="close"
     >
       <view class="nut-picker__bar">
@@ -47,7 +50,7 @@
 import { reactive, watch, computed, toRaw, toRefs } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 import column from './Column.vue';
-import popup from '@/packages/__VUE/popup/index.vue';
+import popup, { popupProps } from '@/packages/__VUE/popup/index.vue';
 import { commonProps } from './commonProps';
 import {
   PickerObjOpt,
@@ -63,10 +66,7 @@ export default create({
     [popup.name]: popup
   },
   props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
+    ...popupProps,
     title: {
       type: String,
       default: ''