• React(JSX语法)----JSX拼写


    注意:For DOM differences,such as the inline style attribute,check here.

    // bad: it displays "FIrst · second" 
    <div>{'First &middot; Second'}</div>

      There are various ways to work-around this issue.The easiest one is to write unicode cahracter directly in JavaScript.You need to make sure the file is saved as UTF-8 and that the proper UTF-8 directive are set so the brower will display it correctly.

    <div>{'First u00b7 Second'}</div>
    <div>{'First' + String.fromCharCode(183) + 'Second'}</div>
    

      

    <div>{['First',<span>·</span>,'Second']}</div>
    

      

    <div dangerouslySetInnerHTML = {{__html:'First · Second'}}>
    

     

      if you pass properties to native HTML elements that do not exist in the HTML specification,React will not render them. if you want to use a custom attribute,you should prefix it with data-

    <div data-custom-attribute = "foo">
    

      web Accessibility attributes starting with aria- will be rendered properly.

    <div aria-hidden = {true}>
    

      

  • 相关阅读:
    WLC-Download 3-party CA to WLC
    WLC-生成CSR操作
    MSE-初始化MSE
    Nexus-产品认识
    Nexus-配置VDC
    Nexus-VDC(Virtual Device Context)
    Nexus-FEX基础配置
    Nexus-配置vPC 实验三
    Nexus-配置vPC 实验二
    Nexus-配置vPC 实验一
  • 原文地址:https://www.cnblogs.com/jodie-blog/p/5110846.html
Copyright © 2020-2023  润新知