logo
  • 教程列表
  • SO官方文檔
  • 多個道具渲染
    • 渲染多個變數
  1. StackOverflow 文件
  2. react-native 教程
  3. 多個道具渲染
  4. 渲染多個變數

渲染多個變數

Created: November-22, 2018

為了渲染多個道具或變數,我們可以使用 `` 。

  render() {
    let firstName = 'test';
    let lastName = 'name';
    return (
      <View style={styles.container}>
        <Text>{`${firstName} ${lastName}` } </Text>
      </View>
    );
  }

輸出:測試名稱

  • 多個道具渲染

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明