Browse Source

Merge branch 'v2' of https://github.com/jdf2e/nutui into v2

苏子刚 6 years ago
parent
commit
4aabae00ea
3 changed files with 32 additions and 6 deletions
  1. 1 2
      build/webpack.base.conf.js
  2. 25 1
      src/packages/dialog/demo.vue
  3. 6 3
      src/packages/dialog/dialog.vue

+ 1 - 2
build/webpack.base.conf.js

@@ -28,8 +28,7 @@ module.exports = {
         rules: [
             !test ? {
                 test: /\.(sa|sc|c)ss$/,
-                use: [
-                    'cache-loader',
+                use: [                    
                     isDev ? 'style-loader' : MiniCssExtractPlugin.loader,
                     'css-loader',
                     'postcss-loader',

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

@@ -75,6 +75,26 @@
       
       <a href="javascript:;" @click="dialogShow=false" :noCancelBtn="true">点我可以直接关闭对话框</a>
     </nut-dialog>
+    <nut-actionsheet :is-visible="isEditor" > 
+      <div slot="custom"> 
+        <nut-cell title="选择货品" :showIcon="true" :isLink="true" @click.native="isItem=true"> 
+          <div slot="desc" class="selected-option">{{item.name!='' ? item.name : '请选择'}}</div>
+        </nut-cell> 
+        <nut-cell :isLink="true" > 
+          <div slot="title" class="selected-option">
+          <nut-textinput v-model="item.num" :hasBorder="false" placeholder="请输入数量" :clearBtn="true" :disabled="false"/> </div> 
+        </nut-cell>
+        <nut-cell :isLink="true" > 
+           <div slot="title" class="selected-option"> 
+             <nut-textinput v-model="item.price" :hasBorder="false" placeholder="请输入价格" :clearBtn="true" :disabled="false"/> 
+          </div> 
+        </nut-cell> 
+        <nut-buttongroup shape="circle" style="margin-top:10px;padding:10px;">
+           <nut-button color="#333" style="background:#eee" @click.native="isEditor=false"> 取消 </nut-button> 
+           <nut-button style="background:#42b983" @click.native="addItem"> 确定 </nut-button> 
+        </nut-buttongroup>
+      </div> 
+    </nut-actionsheet>
   </div>
 </template>
 
@@ -86,7 +106,11 @@ export default {
   mixins: [locale],
   data() {
     return {
-      dialogShow: false
+      dialogShow: false,
+      isEditor:true,
+      item:{
+        
+      }
     };
   },
   methods: {

+ 6 - 3
src/packages/dialog/dialog.vue

@@ -194,13 +194,16 @@ export default {
         this.onOkBtn.call(this);
       }
     },
-    cancelBtnClick(autoClose) {
-      debugger
+    cancelBtnClick(autoClose) {      
+      if(!autoClose){
+        return
+      }
       this.$emit("cancel-btn-click");
       if (typeof this.onCancelBtn === "function") {
         if (this.onCancelBtn.call(this) === false) return;
       }
-      autoClose && this.close("cancelBtn");
+      this.close("cancelBtn");
+         
     },
     closeBtnClick() {
       if (typeof this.onCloseBtn === "function") {