在iview中render函数使用Switch功能

2,020 阅读1分钟

在使用iview开发过程中,遇到在table中加入switch的一个功能,在一番折腾之后,终于弄出来啦,啥也不多说直接上代码

	render:(h,params)=>{
		return h('i-switch',{
			props:{
				value:params.row.status
				size:'large'
			},
			scopedSlots:{
				open:()=>h('span','开启'),
				close:()=>h('span','停用')
			}
		})
	}