zoukankan      html  css  js  c++  java
  • 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}>
    

      

  • 相关阅读:
    Dockerfile基于centos镜像编译安装httpd
    Dockerfile基于centos镜像编译安装nginx
    Dockerfile介绍和常用指令
    Docker存储卷
    正则表达式
    Sed与Awk
    Shell函数
    Shell脚本基础
    Autofs
    Podman
  • 原文地址:https://www.cnblogs.com/jodie-blog/p/5110846.html
Copyright © 2011-2022 走看看