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.
fix: 修复微信小程序中关于form,backtop,checkbox和radio的多个问题
- Loading branch information
Showing
14 changed files
with
178 additions
and
178 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
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,132 +1,132 @@ | ||
<template> | ||
<view | ||
class="u-page" | ||
ref="u-back-top" | ||
> | ||
<view class="u-demo-block"> | ||
<text class="u-demo-block__title">自定义backTop(滚动页面即可在右下角看到图标)</text> | ||
<view class="u-demo-block__content"> | ||
<view class="u-page__backTop-item"> | ||
<u-checkbox-group | ||
placement="column" | ||
shape="square" | ||
@change="checkboxChange" | ||
:value="['自定义图标']" | ||
> | ||
<u-checkbox | ||
:customStyle="{marginBottom: '8px'}" | ||
v-for="(item, index) in checkboxList" | ||
:key="index" | ||
:label="item.name" | ||
:name="item.name" | ||
> | ||
</u-checkbox> | ||
</u-checkbox-group> | ||
</view> | ||
</view> | ||
</view> | ||
<u-back-top | ||
:right="backTopData.right" | ||
:customStyle="backTopData.customStyle" | ||
:bottom="backTopData.bottom" | ||
:icon="backTopData.icon" | ||
:mode="backTopData.mode" | ||
:iconStyle="backTopData.iconStyle" | ||
:duration="backTopData.duration" | ||
:scrollTop="scrollTop" | ||
@click="click" | ||
></u-back-top> | ||
</view> | ||
</template> | ||
|
||
<script> | ||
// const dom = weex.requireModule('dom') | ||
export default { | ||
data() { | ||
<template> | ||
<view | ||
class="u-page" | ||
ref="u-back-top" | ||
> | ||
<view class="u-demo-block"> | ||
<text class="u-demo-block__title">自定义backTop(滚动页面即可在右下角看到图标)</text> | ||
<view class="u-demo-block__content"> | ||
<view class="u-page__backTop-item"> | ||
<u-checkbox-group | ||
placement="column" | ||
shape="square" | ||
@change="checkboxChange" | ||
v-model="value" | ||
> | ||
<u-checkbox | ||
:customStyle="{marginBottom: '8px'}" | ||
v-for="(item, index) in checkboxList" | ||
:key="index" | ||
:label="item.name" | ||
:name="item.name" | ||
> | ||
</u-checkbox> | ||
</u-checkbox-group> | ||
</view> | ||
</view> | ||
</view> | ||
<u-back-top | ||
:right="backTopData.right" | ||
:customStyle="backTopData.customStyle" | ||
:bottom="backTopData.bottom" | ||
:icon="backTopData.icon" | ||
:mode="backTopData.mode" | ||
:iconStyle="backTopData.iconStyle" | ||
:duration="backTopData.duration" | ||
:scrollTop="scrollTop" | ||
@click="click" | ||
></u-back-top> | ||
</view> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
backTopData: { | ||
mode: 'circle', | ||
icon: 'arrow-upward', | ||
bottom: 100, | ||
customStyle: {}, | ||
iconStyle: {}, | ||
right:20, | ||
duration: 300 | ||
}, | ||
scrollTop: 0, | ||
// 被自定义的样式 | ||
checkboxList: [{ | ||
name: '显示方形', | ||
}, | ||
{ | ||
name: '自定义图标', | ||
}, | ||
{ | ||
name: '自定义距离', | ||
}, | ||
{ | ||
name: '自定义样式', | ||
}, | ||
{ | ||
name:'自定义返回顶部滚动时间', | ||
} | ||
] | ||
} | ||
}, | ||
onLoad() { | ||
// 演示中默认勾选了自定义图标 | ||
this.backTopData.icon = "arrow-up" | ||
}, | ||
onPageScroll(e) { | ||
this.scrollTop = e.scrollTop; | ||
}, | ||
methods: { | ||
checkboxChange(n) { | ||
if (n.includes('显示方形')) { | ||
this.backTopData.mode = 'square' | ||
} else { | ||
this.backTopData.mode = "circle" | ||
} | ||
if (n.includes('自定义图标')) { | ||
this.backTopData.icon = "arrow-up" | ||
} else { | ||
this.backTopData.icon = "arrow-upward" | ||
} | ||
if (n.includes('自定义距离')) { | ||
this.backTopData.bottom = 300 | ||
this.backTopData.right=20 | ||
} else { | ||
this.backTopData.bottom = 100 | ||
} | ||
if (n.includes('自定义样式')) { | ||
this.backTopData.customStyle = { | ||
backgroundColor: '#2979ff', | ||
} | ||
this.backTopData.iconStyle = { | ||
color: '#ffffff' | ||
} | ||
} else { | ||
this.backTopData.customStyle = {} | ||
this.backTopData.iconStyle = {} | ||
} | ||
if (n.includes('自定义返回顶部滚动时间')) { | ||
this.backTopData.duration =1500 | ||
} else { | ||
this.backTopData.duration =300 | ||
} | ||
}, | ||
click() { | ||
console.log('click'); | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
.u-page { | ||
height: 1200px; | ||
&__backTop-item{ | ||
margin-top:10px; | ||
} | ||
} | ||
</style> | ||
value: ['自定义图标'], | ||
backTopData: { | ||
mode: 'circle', | ||
icon: 'arrow-upward', | ||
bottom: 100, | ||
customStyle: {}, | ||
iconStyle: {}, | ||
right:20, | ||
duration: 300 | ||
}, | ||
scrollTop: 0, | ||
// 被自定义的样式 | ||
checkboxList: [{ | ||
name: '显示方形', | ||
}, | ||
{ | ||
name: '自定义图标', | ||
}, | ||
{ | ||
name: '自定义距离', | ||
}, | ||
{ | ||
name: '自定义样式', | ||
}, | ||
{ | ||
name:'自定义返回顶部滚动时间', | ||
} | ||
] | ||
} | ||
}, | ||
onLoad() { | ||
// 演示中默认勾选了自定义图标 | ||
this.backTopData.icon = "arrow-up" | ||
}, | ||
onPageScroll(e) { | ||
this.scrollTop = e.scrollTop; | ||
}, | ||
methods: { | ||
checkboxChange(n) { | ||
if (n.includes('显示方形')) { | ||
this.backTopData.mode = 'square' | ||
} else { | ||
this.backTopData.mode = "circle" | ||
} | ||
if (n.includes('自定义图标')) { | ||
this.backTopData.icon = "arrow-up" | ||
} else { | ||
this.backTopData.icon = "arrow-upward" | ||
} | ||
if (n.includes('自定义距离')) { | ||
this.backTopData.bottom = 300 | ||
this.backTopData.right=20 | ||
} else { | ||
this.backTopData.bottom = 100 | ||
} | ||
if (n.includes('自定义样式')) { | ||
this.backTopData.customStyle = { | ||
backgroundColor: '#2979ff', | ||
} | ||
this.backTopData.iconStyle = { | ||
color: '#ffffff' | ||
} | ||
} else { | ||
this.backTopData.customStyle = {} | ||
this.backTopData.iconStyle = {} | ||
} | ||
if (n.includes('自定义返回顶部滚动时间')) { | ||
this.backTopData.duration =1500 | ||
} else { | ||
this.backTopData.duration =300 | ||
} | ||
}, | ||
click() { | ||
console.log('click'); | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
.u-page { | ||
height: 1200px; | ||
&__backTop-item{ | ||
margin-top:10px; | ||
} | ||
} | ||
</style> |
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
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.