Frans 7 years ago
parent
commit
ec88450f43

+ 1 - 0
package.json

@@ -18,6 +18,7 @@
     "dev": "npm run dev:demo",
     "dev:carefree": "cross-env NODE_ENV=carefree carefree_env=dev webpack -w --colors --progress --config build/webpack.demo.dev.conf.js",
     "build:doc": "cross-env NODE_ENV=production webpack --hide-modules --progress --config build/webpack.doc.build.conf.js",
+    "build:site": "npm run build:demo && npm run build:doc",
     "build:prod": "cross-env NODE_ENV=production webpack --hide-modules --progress --config build/webpack.prod.conf.js && node scripts/createIndexScss.js",
     "build:prodmin": "cross-env NODE_ENV=production webpack --hide-modules --progress --config build/webpack.prod.mini.conf.js",
     "build:disp": "cross-env NODE_ENV=production webpack --hide-modules --progress --config build/webpack.disperse.conf.js",

+ 1 - 4
sites/demo/view/index.vue

@@ -112,13 +112,12 @@ export default {
   width: 95%;
   background: #fff;
   border-radius: 5px;
-  max-height:55px;
-  transition: max-height 1s;
   overflow:hidden;
   h4 {
     position: relative;
     margin: 0;
     height: 50px;
+    font-weight: normal;
     line-height: 50px;
     padding: 0 15px;
     &:active {
@@ -139,8 +138,6 @@ export default {
     }
   }
   &.unfold {
-    max-height:1000px;
-    transition: max-height 1s;
     h4 i {
       transform: rotate(-180deg);
     }

File diff suppressed because it is too large
+ 33 - 0
src/packages/dialog/demo.vue


+ 4 - 3
src/packages/dialog/dialog.scss

@@ -114,7 +114,7 @@ body.dialog-open {
     padding: 30px 20px 20px;
     display: flex;
     flex-direction: column;
-    flex: 1;
+    flex: 0 1 auto;
 }
 
 .nut-dialog-content {
@@ -141,7 +141,7 @@ body.dialog-open {
 .nut-dialog-btn {
     display: block;
     width: 100%;
-    height:100%;
+    height: 100%;
     flex: 1;
     font-size: $font-size-base;
     border: none;
@@ -158,7 +158,7 @@ body.dialog-open {
         color: $primary-color;
         border-top: 1px solid $light-color;
     }
-    &:active{
+    &:active {
         opacity: .7;
     }
 }
@@ -172,6 +172,7 @@ body.dialog-open {
 .nut-dialog-cancel {
     border-radius: 0 0 0 5px;
     border-top: 1px solid $light-color;
+    background: #FFF;
 }
 
 // .fade-enter-active {

+ 13 - 1
src/packages/dialog/doc.md

@@ -36,9 +36,21 @@ this.$dialog({
         
 ```
 
+## 页面滚动锁定
+
+**lockBgScroll** 值设为 **true** 时,可在弹窗出现时锁定页面滚动,且不影响窗体内部滚动。
+
+```javascript
+this.$dialog({
+        title: "背景滚动锁定",
+        lockBgScroll:true,
+        content:"弹窗弹出后,页面滚动锁止。在窗体和遮罩层上滑动时,页面不再跟随滚动。"
+});
+```
+
 ## 图片弹窗
 
-**type**值为 **image** 时为图片弹窗,需要配置一张图片,可带链接(非必须)。默认展示关闭按钮。点击图片触发 **onClickImageLink** 事件,返回**false**可阻止默认的跳转链接行为。
+**type** 值为 **image** 时为图片弹窗,需要配置一张图片,可带链接(非必须)。默认展示关闭按钮。点击图片触发 **onClickImageLink** 事件,返回**false**可阻止默认的跳转链接行为。
 
 ```javascript
 this.$dialog({