在render()中循环数据,根据数据不同展示标签不同
import React from 'react';
const quanList=[
{
id:1,
buy_price:1,//购买券的价格
quan_price:30,//可抵扣价格
quanName:'仅限(学习机)商品使用',
on_time:'2020-11-01',
off_time:'2020-11-30',
isHave:false,
},
{
id:2,
buy_price:3,//购买券的价格
quan_price:30,//可抵扣价格
quanName:'通用券',
on_time:'2020-11-01',
off_time:'2020-11-30',
isHave:true,
},
];
export default class QuanList extends React.Component{
constructor(props){
super(props);
this.state={
data:quanList,
}
}
render(){
return(
)
}
}
作者:qq_41315539