react app store button
1.0.0
一个React组件,可让您创建iOS App Store或Google Play商店下载按钮。此按钮:
svg
文件,因此不必担心分辨率url
, width
和height
指定您的应用商店按钮"iosDark"
, "iosLight"
或"android"
如果您只想要图像,可以在这里获取它们:iosdark ioslight android
示例代码:
import MobileStoreButton from 'react-mobile-store-button' ;
////
export default class MyComponent extends React . Component {
render ( ) {
const iOSUrl = 'https://itunes.apple.com/us/app/all-of-the-lights/id959389722?mt=8' ;
return (
< div >
< MobileStoreButton
store = "ios"
url = { iOSUrl }
linkProps = { { title : 'iOS Store Button' } }
/ >
< / div >
) ;
}
}
您将在网页上获得iOS App Store Dwonload按钮,如下所示:
使用npm
或yarn
安装
npm install --save react-mobile-store-button
git clone https://github.com/rizzomichaelg/react-mobile-store-button.git
cd react-mobile-store-button/example
yarn && yarn start
麻省理工学院