Skip to content

Instantly share code, notes, and snippets.

@swt02026
Created December 6, 2018 08:30
Show Gist options
  • Save swt02026/4f44a7155c80a239b8b545d9b09bc3dc to your computer and use it in GitHub Desktop.
Save swt02026/4f44a7155c80a239b8b545d9b09bc3dc to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Our Code World Rocks</title>
<link rel="stylesheet" href="node_modules/vue-virtual-scroller/dist/vue-virtual-scroller.css">
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css">
<script src="node_modules/vue/dist/vue.js"></script>
<script src="node_modules/vue-virtual-scroller/dist/vue-virtual-scroller.min.js"></script>
</head>
<body>
<div id="msglist">
<RecycleScroller :items="msgs" :item-height="40">
<div slot-scope="{ item }">{{ item.msg }}</div>
</RecycleScroller>
</div>
<script>
Vue.component('RecycleScroller', VueVirtualScroller.RecycleScroller);
'use strict';
let msglist = new Vue({
el: '#msglist',
data: {
msgs: []
}
});
const {ipcRenderer} = require('electron');
ipcRenderer.on('update_msg', (event, msg_list)=>{
msglist.msgs.push(...msg_list);
});
ipcRenderer.on('update_log',(event, log_content)=>{
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment