[improvement] Dialog: 内容区支持换行展示

This commit is contained in:
Yao 2018-03-28 19:36:09 +08:00 committed by GitHub
parent 53a75db35c
commit 15ecc4120a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -4,7 +4,7 @@ Page(Object.assign({}, Zan.Dialog, {
toggleBaseDialog() { toggleBaseDialog() {
this.showZanDialog({ this.showZanDialog({
title: '弹窗', title: '弹窗',
content: '这是一个模态弹窗', content: '这是一个模态弹窗\n换行',
showCancel: true showCancel: true
}).then(() => { }).then(() => {
console.log('=== dialog ===', 'type: confirm'); console.log('=== dialog ===', 'type: confirm');

View File

@ -4,11 +4,16 @@
<view class="zan-dialog--container"> <view class="zan-dialog--container">
<view <view
wx:if="{{ zanDialog.title }}" wx:if="{{ zanDialog.title }}"
class="zan-dialog__header">{{ zanDialog.title }}</view> class="zan-dialog__header"
>{{ zanDialog.title }}</view>
<view <view
class="zan-dialog__content {{ zanDialog.title ? 'zan-dialog__content--title' : '' }}">{{ zanDialog.content }}</view> class="zan-dialog__content {{ zanDialog.title ? 'zan-dialog__content--title' : '' }}"
>
<text>{{ zanDialog.content }}</text>
</view>
<view <view
class="zan-dialog__footer {{ zanDialog.buttonsShowVertical ? 'zan-dialog__footer--vertical' : 'zan-dialog__footer--horizon' }}"> class="zan-dialog__footer {{ zanDialog.buttonsShowVertical ? 'zan-dialog__footer--vertical' : 'zan-dialog__footer--horizon' }}"
>
<block wx:for="{{ zanDialog.buttons }}" wx:key="{{ item.text }}-{{ item.type }}"> <block wx:for="{{ zanDialog.buttons }}" wx:key="{{ item.text }}-{{ item.type }}">
<button <button
class="zan-dialog__button zan-btn" class="zan-dialog__button zan-btn"