forked from umicro/uView2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'github/master'
# Conflicts: # uni_modules/uview-ui/components/u-input/u-input.vue
- Loading branch information
Showing
14 changed files
with
471 additions
and
566 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,195 +1,195 @@ | ||
<template> | ||
<view class="u-page"> | ||
<u-navbar | ||
title="模态框" | ||
@leftClick="navigateBack" | ||
safeAreaInsetTop | ||
fixed | ||
placeholder | ||
></u-navbar> | ||
<u-gap | ||
height="20" | ||
bgColor="#fff" | ||
></u-gap> | ||
<u-cell-group> | ||
<u-cell | ||
@click="showModal(index)" | ||
:title="item.title" | ||
v-for="(item, index) in list" | ||
:key="index" | ||
isLink | ||
> | ||
<image | ||
slot="icon" | ||
class="u-cell-icon" | ||
:src="item.iconUrl" | ||
mode="widthFix" | ||
></image> | ||
</u-cell> | ||
</u-cell-group> | ||
<u-modal | ||
:content="content" | ||
title="标题" | ||
:show="show1" | ||
@confirm="() => show1 = false" | ||
></u-modal> | ||
<u-modal | ||
:content="content" | ||
:show="show2" | ||
@confirm="() => show2 = false" | ||
></u-modal> | ||
<u-modal | ||
:content="content" | ||
:show="show3" | ||
showCancelButton | ||
closeOnClickOverly | ||
@confirm="confirm" | ||
@cancel="cancel" | ||
@close="close" | ||
></u-modal> | ||
<u-modal | ||
:content="content" | ||
:show="show4" | ||
showCancelButton | ||
asyncClose | ||
@confirm="confirm4" | ||
@cancel="() => show4 = false" | ||
></u-modal> | ||
<u-modal | ||
:content="content" | ||
:show="show5" | ||
showCancelButton | ||
buttonReverse | ||
@confirm="() => show5 = false" | ||
@cancel="() => show5 = false" | ||
></u-modal> | ||
<u-modal | ||
:content="content" | ||
title="标题" | ||
:show="show6" | ||
closeOnClickOverly | ||
@confirm="() => show6 = false" | ||
@close="() => show6 = false" | ||
></u-modal> | ||
<u-modal | ||
title="利剑出鞘,一统江湖" | ||
:show="show7" | ||
closeOnClickOverly | ||
@confirm="() => show7 = false" | ||
> | ||
<image | ||
style="width: 80px;height: 80px;" | ||
src="/static/uview/common/logo.png" | ||
></image> | ||
</u-modal> | ||
<u-modal | ||
title="标题" | ||
:show="show8" | ||
:content="content" | ||
closeOnClickOverly | ||
showCancelButton | ||
> | ||
<u-button | ||
slot="confirmButton" | ||
text="确定" | ||
type="success" | ||
shape="circle" | ||
@click="show8 = false" | ||
></u-button> | ||
</u-modal> | ||
<u-modal | ||
:content="content" | ||
title="标题" | ||
:show="show9" | ||
:zoom="false" | ||
@confirm="() => show9 = false" | ||
></u-modal> | ||
</view> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
<template> | ||
<view class="u-page"> | ||
<u-navbar | ||
title="模态框" | ||
@leftClick="navigateBack" | ||
safeAreaInsetTop | ||
fixed | ||
placeholder | ||
></u-navbar> | ||
<u-gap | ||
height="20" | ||
bgColor="#fff" | ||
></u-gap> | ||
<u-cell-group> | ||
<u-cell | ||
@click="showModal(index)" | ||
:title="item.title" | ||
v-for="(item, index) in list" | ||
:key="index" | ||
isLink | ||
> | ||
<image | ||
slot="icon" | ||
class="u-cell-icon" | ||
:src="item.iconUrl" | ||
mode="widthFix" | ||
></image> | ||
</u-cell> | ||
</u-cell-group> | ||
<u-modal | ||
:content="content" | ||
title="标题" | ||
:show="show1" | ||
@confirm="() => show1 = false" | ||
></u-modal> | ||
<u-modal | ||
:content="content" | ||
:show="show2" | ||
@confirm="() => show2 = false" | ||
></u-modal> | ||
<u-modal | ||
:content="content" | ||
:show="show3" | ||
showCancelButton | ||
closeOnClickOverly | ||
@confirm="confirm" | ||
@cancel="cancel" | ||
@close="close" | ||
></u-modal> | ||
<u-modal | ||
:content="content" | ||
:show="show4" | ||
showCancelButton | ||
asyncClose | ||
@confirm="confirm4" | ||
@cancel="() => show4 = false" | ||
></u-modal> | ||
<u-modal | ||
:content="content" | ||
:show="show5" | ||
showCancelButton | ||
buttonReverse | ||
@confirm="() => show5 = false" | ||
@cancel="() => show5 = false" | ||
></u-modal> | ||
<u-modal | ||
:content="content" | ||
title="标题" | ||
:show="show6" | ||
closeOnClickOverly | ||
@confirm="() => show6 = false" | ||
@close="() => show6 = false" | ||
></u-modal> | ||
<u-modal | ||
title="利剑出鞘,一统江湖" | ||
:show="show7" | ||
closeOnClickOverly | ||
@confirm="() => show7 = false" | ||
> | ||
<image | ||
style="width: 80px;height: 80px;" | ||
src="/static/uview/common/logo.png" | ||
></image> | ||
</u-modal> | ||
<u-modal | ||
title="标题" | ||
:show="show8" | ||
:content="content" | ||
closeOnClickOverly | ||
showCancelButton | ||
> | ||
<u-button | ||
slot="confirmButton" | ||
text="确定" | ||
type="success" | ||
shape="circle" | ||
@click="show8 = false" | ||
></u-button> | ||
</u-modal> | ||
<u-modal | ||
:content="content" | ||
title="标题" | ||
:show="show9" | ||
:zoom="false" | ||
@confirm="() => show9 = false" | ||
></u-modal> | ||
</view> | ||
</template> | ||
<script> | ||
export default { | ||
data() { | ||
return { | ||
content: '模态框,常用于消息提示、消息确认、在当前页面内完成特定的交互操作', | ||
show1: false, | ||
show2: false, | ||
show3: false, | ||
show4: false, | ||
show5: false, | ||
show6: false, | ||
show7: false, | ||
show8: false, | ||
show9: false, | ||
list: [{ | ||
title: '基础使用', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/4.png' | ||
}, | ||
{ | ||
title: '无标题', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/5.png' | ||
}, | ||
{ | ||
title: '带取消按钮', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/2.png' | ||
}, | ||
{ | ||
title: '异步关闭', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/6.png' | ||
}, | ||
{ | ||
title: '对调取消和确认按钮', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/3.png' | ||
}, | ||
{ | ||
title: '允许点击遮罩关闭', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/7.png' | ||
}, | ||
{ | ||
title: '传入slot', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/1.png' | ||
}, | ||
{ | ||
title: '自定义按钮', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/8.png' | ||
}, | ||
{ | ||
title: '淡入淡出动画', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/9.png' | ||
} | ||
] | ||
} | ||
}, | ||
methods: { | ||
showModal(index) { | ||
this[`show${index + 1}`] = true | ||
}, | ||
navigateBack() { | ||
uni.navigateBack() | ||
}, | ||
confirm4() { | ||
setTimeout(() => { | ||
this.show4 = false | ||
}, 2000) | ||
}, | ||
confirm() { | ||
this.show3 = false | ||
console.log('confirm'); | ||
}, | ||
cancel() { | ||
this.show3 = false | ||
console.log('cancel'); | ||
}, | ||
close() { | ||
this.show3 = false | ||
console.log('close'); | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
.u-page { | ||
padding: 0; | ||
} | ||
</style> | ||
content: '模态框,常用于消息提示、消息确认、在当前页面内完成特定的交互操作', | ||
show1: false, | ||
show2: false, | ||
show3: false, | ||
show4: false, | ||
show5: false, | ||
show6: false, | ||
show7: false, | ||
show8: false, | ||
show9: false, | ||
list: [{ | ||
title: '基础使用', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/4.png' | ||
}, | ||
{ | ||
title: '无标题', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/5.png' | ||
}, | ||
{ | ||
title: '带取消按钮', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/2.png' | ||
}, | ||
{ | ||
title: '异步关闭', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/6.png' | ||
}, | ||
{ | ||
title: '对调取消和确认按钮', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/3.png' | ||
}, | ||
{ | ||
title: '允许点击遮罩关闭', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/7.png' | ||
}, | ||
{ | ||
title: '传入slot', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/1.png' | ||
}, | ||
{ | ||
title: '自定义按钮', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/8.png' | ||
}, | ||
{ | ||
title: '淡入淡出动画', | ||
iconUrl: 'https://cdn.uviewui.com/uview/demo/modal/9.png' | ||
} | ||
] | ||
} | ||
}, | ||
methods: { | ||
showModal(index) { | ||
this[`show${index + 1}`] = true | ||
}, | ||
navigateBack() { | ||
uni.navigateBack() | ||
}, | ||
confirm4() { | ||
setTimeout(() => { | ||
this.show4 = false | ||
}, 2000) | ||
}, | ||
confirm() { | ||
this.show3 = false | ||
console.log('confirm'); | ||
}, | ||
cancel() { | ||
this.show3 = false | ||
console.log('cancel'); | ||
}, | ||
close() { | ||
this.show3 = false | ||
console.log('close'); | ||
} | ||
} | ||
} | ||
</script> | ||
<style lang="scss"> | ||
.u-page { | ||
padding: 0; | ||
} | ||
</style> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.