Skip to content

Commit

Permalink
Merge branch 'v2' of https://github.com/jdf2e/nutui into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
苏子刚 authored and 苏子刚 committed Oct 15, 2019
2 parents c758b67 + ebbd060 commit 4aabae0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
3 changes: 1 addition & 2 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
26 changes: 25 additions & 1 deletion src/packages/dialog/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -86,7 +106,11 @@ export default {
mixins: [locale],
data() {
return {
dialogShow: false
dialogShow: false,
isEditor:true,
item:{
}
};
},
methods: {
Expand Down
9 changes: 6 additions & 3 deletions src/packages/dialog/dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down

0 comments on commit 4aabae0

Please sign in to comment.