react-adsence:简单的 Google 广告 React 组件

react-adsence react-adsence is a React-component for Google AdSence Baidu advertisement 1 Install npm inst

react-adsence

react-adsence is a React-component for Google AdSence / Baidu advertisement.

1. Install

npm install react-adsence

Before use Google AdSence, you should add the script

at the end of HTML.

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

2. Usage

import React from 'react';

import AdSence from 'react-adsence';

<AdSence.Google client='ca-pub-7292810486004926'

slot='7806394673' />

// or

<AdSence.Google client='ca-pub-7292810486004926'

slot='7806394673'

style={{width: 500, height: 300, float: 'left'}}

format='' />

3. TODO

  • Baidu

    advertisement supported.

  • Google

    sync adsence supported.

4. LICENSE

MIT

未登录用户
全部评论0
到底啦