Vue记录Ant design 中 jsx 写法

初识项目Ant Design 中 jsx 写法

初识项目Ant Design 中 jsx 写法

在Design 中 表格 columns中 写 jsx 写法

customRender:(text, row, index ) =>{
这里是的三个参数分别是

  • 1、文本页面渲染内容,
    2、row 是 当前行表格的所有参数
    3、index 是索引
    我们现在在里面写我们所需要的jsx 写法 ,jsx 的写法 源于react 是Vue 中 render 渲染封装的上一层,

     具体实现:
     	<div>
     		  //注释:ant design Ui 
     		<a-button  onClick= { ()=>this.xxx() } > 
     				//这里解释一下 jsx 中写法 事件都是on 开头,一对花括号 对象 包含 ES6的方法  this.xxx自己声明的事件。
     				{text}
     		</a-button>
     		
     		<a-modal
             title={`确定要更改` + PLAN_STATUS_MAPPING.get(status) + `状态?`}
             destroyOnClose={true}
             visible={this.visibleOne}
             confirm-loading={this.confirmLoading}
             onok={() => this.handleOk()}
             oncancel={() => this.handleCancel(false)}
           >
           </a-modal>
     	//这里我要讲的是 onok 和 oncancel 这两个事件,
     	//一个确定一个取消是 ant design 的能力,但是我们要想使用,需要 在前面加上 on 而不是 @
     	// 包括变量赋值也是 不再是 :号 单项绑定模式 而是直接 对象 给值即可
    
     	</div>
    

}
//这里我要讲的是 onok 和 oncancel 这两个事件,
//一个确定一个取消是 ant design 的能力,但是我们要想使用,需要 在前面加上 on 而不是 @
// 包括变量赋值也是 不再是 :号 单项绑定模式 而是直接 对象 给值即可

猜你喜欢

转载自blog.csdn.net/weixin_45796807/article/details/111678696