/* eslint-disable no-console */ import { reactive, ref } from 'vue'; import List from '../List'; import './basic.less'; const MyItem = (_, { attrs: { id } }) => ( { console.log('Click:', id); }} > {id} ); const TestItem = { render() { return
{this.$attrs.id}
; }, }; const data = []; for (let i = 0; i < 1000; i += 1) { data.push({ id: String(i), }); } const TYPES = [ { name: 'ref real dom element', type: 'dom' }, { name: 'ref vue node', type: 'vue' }, ]; const onScroll = e => { console.log('scroll:', e.currentTarget.scrollTop); }; const state = reactive({ destroy: false, visible: true, type: 'dom', }); const listRef = ref(null); const Demo = () => { const { destroy, visible, type } = state; return (

Basic

{TYPES.map(({ name, type: nType }) => ( ))} {!destroy && ( type === 'dom' ? : } > )}
); }; export default Demo; /* eslint-enable */