basic.js 983 Bytes
Newer Older
duanledexianxianxian's avatar
init  
duanledexianxianxian committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
import React from 'react';
import List from './components/list'

const Index = () => {
  const dataSource = [
    {
      id: 1,
      image: '/images/exam1.png',
      title: '2020版中西医结合执业助理医师 模拟试',
      like: 0,
      share: 1,
    },
    {
      id: 2,
      image: '/images/exam1.png',
      title: '2020版中西医结合执业助理医师 模拟试',
      like: 0,
      share: 0,
    },
    {
      id: 3,
      image: '/images/exam1.png',
      title: '2020版中西医结合执业助理医师 模拟试',
      like: 1,
      share: 1,
    },
  ];

  const onClickLike = id => {
    console.log(id);
  };
  const onClickShare = id => {
    console.log(id);
  };
  
  const onClickButton = id => {
    console.log(id);
  };
  

  const opt={
    dataSource,
    buttonLable:"立即答题",
    onClickLike,
    onClickShare,
    onClickButton
  }
    return (
      <>
          <List {...opt}></List>
      </>
    );
}

export default Index;