当前位置:网站首页>JSX use
JSX use
2022-08-04 13:02:00 【monstkl】
Foreword:
JSX stands for javascript XML.A small amount of js scripts are written in different vue templates, and JSX is to write html tags in js
1. js expressions in JSX
Syntax: {js expression}eg:const dom = Hello, I'm {name}
Second, conditional rendering of JSX
const sondom = () => {if (flag) {return correct} else {return error}}const fatherdom = ({sondom()})
Three, JSX list rendering
const listdom = ({list.forEach(item => - {item.name}
)}
)
Fourth, use inline styles in JSX
const dom = {color:'red',backgroundColor:'blue'}}>
Five, using class names in JSX
Introduce style files into jsimport '../../css/index.css'index.css.la-title{...}const dom =
边栏推荐
猜你喜欢
随机推荐
leetcode 48. Rotate Image 旋转图像(Medium)
Matlab记录
Arduino框架下I2S控制ADC采样以及PWM输出示例解析
Access Huawei game anti-addiction, click the anti-addiction pop-up window, the game crashes
双目立体视觉笔记(二)
《社会企业开展应聘文职人员培训规范》团体标准在新华书店上架
Control CD-ROM with VbScript
"Lonely Walking on the Moon" is a powerful medicine, it can't cure the internal friction of happy twist
c#学习_第二弹
微信小程序使用腾讯云对象储存上传图片
面试官:连 INSERT INTO SET 都不知道怎么用,你这3年都干些什么了?
倒计时 3 天|一起看云原生 Meetup 的六大议题
Billboard
RobotFramework二次开发(一)
yum 查看已经安装过的包并卸载
Opencv学习之ORB特征提取和匹配
内存定位利器-ASAN使用小结
一文梳理NLP主要模型发展脉络
云原生Devops 的实现方法
动规(18)-并查集基础题——团伙