1、当recycle-list内部绑定了一个click事件,在recycle-list结构外部,用fixed定位的元素上面再绑定一个click事件会导致页面崩溃。下面代码是recycle-list的demo上面一点改动,直接运行在IOS,WEEX-Playground上面会崩溃
2、`
<template>
<div>
<recycle-list class="list" for="(cell, i) in counters">
<cell-slot>
<div class="counter" @appear="toast(i)">
<text class="output">{{cell.count}}</text>
<text class="button" @click="inc(i)">+</text>
<text class="index">index: {{i}}</text>
</div>
</cell-slot>
</recycle-list>
<!-- todo:放到list里面,会偶然性地被隐藏掉。-->
<image class="go-top" src="http://img.alicdn.com/tps/TB1zBLaPXXXXXXeXXXXXXXXXXXX-121-59.svg" @click="toast(1)"></image>
</div>
</template>
<script>
const modal = weex.requireModule('modal')
export default {
data () {
let start = 1, N = 100
const counters = []
while (N--) {
counters.push({ count: start++ })
}
return { counters }
},
methods: {
inc (index) {
if (!this.counters[index]) return;
this.counters[index].count++
},
toast (i) {
modal.toast({ message: `appear ${i}: ${this.counters[i].count}` })
}
}
}
</script>
<style scoped>
.list { width: 750px; }
.counter {
position: relative;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #DDD;
margin-bottom: 80px;
}
.index {
position: absolute;
top: 10px;
left: 20px;
color: #BBB;
font-size: 30px;
}
.output {
font-size: 150px;
text-align: center;
padding: 50px;
background-color: #FBFBFB;
}
.button {
border-width: 2px;
border-color: #DDD;
font-size: 100px;
text-align: center;
background-color: #F5F5F5;
}
/* 回到顶部 */
.go-top{
position: fixed;
right: 15wx;
bottom: 90wx;
width: 38wx;
height: 38wx;
}
</style>
`
崩溃信息看看是什么呢。