📜  在材质 ui 中设置背景图像 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:05.980000             🧑  作者: Mango

代码示例1
import React from 'react';

import Paper from 'material-ui/Paper';

import IconButton from 'material-ui/IconButton';
import ActionHome from 'material-ui/svg-icons/action/home';

import Image from '../img/main.jpg'; // Import using relative path


const styles = {
    paperContainer: {
        backgroundImage: `url(${Image})`
    }
};

export default class Home extends React.Component{
    render(){
        return(
            
                Some text to fill the Paper Component
            
        )
    }
}