|
<template>
<view class="page">
<grid-view class="gview" id="gview" scroll-y="true">
<cell>
<rich-text nodes={this.form(index)}></rich-text>
</cell>
</grid-view>
</view>
</template>
<script>
export default {
name: 'test-g',
apiready() {
let arr = [];
for (let index = 0; index < 200; index++) {
arr.push({
nodes: '<!DOCTYPE html><html style="margin:0;padding:0;"><body><span style="font-size:16px;color:#000;white-space:pre-wrap;margin-bottom: 0;padding-bottom: 0;vertical-align: middle;">dasdsadsad<img style="vertical-align: middle;background-color: rgba(0,0,0,0);" width="25px" height="25px" src="widget://image/emojis/Emoji_1.png" /></span></body></html>'
})
}
document.getElementById("gview").load({
data: arr
})
},
data() {
return {
}
},
methods: {
form(index1) {
var int = Math.ceil(Math.random() * 100);
console.log(int)
console.log(index1 + ":indexindexindexindexindexindexindexindexindex")
var _rsl = "";
var _randomUniCode = Math.floor(Math.random() * (40870 - 19968) + 19968).toString(16);
eval("_rsl=" + '"\\u' + _randomUniCode + '"');
var new_ = '';
for (let index = 0; index < int; index++) {
new_ = new_ + _rsl;
}
console.log(_rsl)
return `<!DOCTYPE html>
<html style="margin:0;padding:0;">
<body>
<span style="font-size:16px;color:#000;white-space:pre-wrap;margin-bottom: 0;padding-bottom: 0;vertical-align: middle;">${new_}<img style="vertical-align: middle;background-color: rgba(0,0,0,0);" width="25px" height="25px" src="widget://image/emojis/Emoji_1.png" />
</span>
</body>
</html>`
}
}
}
</script>
<style>
.page {
height: 100%;
}
.gview {
height: 100%;
}
</style> |
|