-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(component): 新增 H5 组件,并新增共同样式 (#10841)
* feat(component): add h5 component error tips * feat(types): 补齐新增组件相关类型 * feat(route): taro-page 滚动条共享问题 fix #7974 Co-authored-by: chenjiajian <[email protected]>
- Loading branch information
1 parent
10c9648
commit 67eba7d
Showing
34 changed files
with
670 additions
and
61 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
packages/taro-components/src/components/ad-custom/ad-custom.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-ad-custom-core' | ||
}) | ||
export class AdCustom { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 AdCustom 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-ad-core' | ||
}) | ||
export class Ad { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 Ad 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-editor-core' | ||
}) | ||
export class Editor { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 Editor 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...es/taro-components/src/components/functional-page-navigator/functional-page-navigator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-functional-page-navigator-core' | ||
}) | ||
export class FunctionalPageNavigator { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 FunctionalPageNavigator 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/taro-components/src/components/keyboard-accessory/keyboard-accessory.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-keyboard-accessory-core' | ||
}) | ||
export class KeyboardAccessory { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 KeyboardAccessory 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/taro-components/src/components/live-player/live-player.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-live-player-core' | ||
}) | ||
export class LivePlayer { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 LivePlayer 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/taro-components/src/components/live-pusher/live-pusher.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-live-pusher-core' | ||
}) | ||
export class LivePusher { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 LivePusher 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-map-core' | ||
}) | ||
export class Map { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 Map 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/taro-components/src/components/match-media/match-media.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-match-media-core' | ||
}) | ||
export class MatchMedia { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 MatchMedia 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
packages/taro-components/src/components/navigation-bar/navigation-bar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-navigation-bar-core' | ||
}) | ||
export class NavigationBar { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 NavigationBar 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/taro-components/src/components/official-account/official-account.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-official-account-core' | ||
}) | ||
export class OfficialAccount { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 OfficialAccount 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/taro-components/src/components/page-container/page-container.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-page-container-core' | ||
}) | ||
export class PageContainer { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 PageContainer 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/taro-components/src/components/page-meta/page-meta.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-page-meta-core' | ||
}) | ||
export class PageMeta { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 PageMeta 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
packages/taro-components/src/components/share-element/share-element.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-share-element-core' | ||
}) | ||
export class ShareElement { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 ShareElement 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-slot-core' | ||
}) | ||
export class Slot { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 Slot 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/taro-components/src/components/voip-room/voip-room.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-voip-room-core' | ||
}) | ||
export class VoipRoom { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 VoipRoom 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@import url(../node_modules/weui/dist/style/weui.min.css); | ||
|
||
.taro_page { | ||
max-height: 100vh; | ||
overflow-x: hidden; | ||
overflow-y: scroll; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { ComponentType } from 'react' | ||
import { StandardProps, CommonEventFunction } from './common' | ||
import { AdProps } from './Ad' | ||
|
||
interface AdCustomProps extends StandardProps { | ||
/** 广告单元id,可在[小程序管理后台](https://mp.weixin.qq.com/)的流量主模块新建 | ||
* @supported weapp | ||
*/ | ||
unitId: string | ||
|
||
/** 广告自动刷新的间隔时间,单位为秒,参数值必须大于等于30(该参数不传入时 Banner 广告不会自动刷新) | ||
* @supported weapp | ||
*/ | ||
adIntervals?: number | ||
|
||
/** 广告加载成功的回调 | ||
* @supported weapp | ||
*/ | ||
onLoad?: CommonEventFunction | ||
|
||
/** 当广告发生错误时,触发的事件,可以通过该事件获取错误码及原因,事件对象event.detail = {errCode: 1002} | ||
* @supported weapp | ||
*/ | ||
onError?: CommonEventFunction<AdProps.onErrorEventDetail> | ||
} | ||
|
||
/** Banner 广告 | ||
* @classification open | ||
* @supported weapp | ||
* @example | ||
* ```tsx | ||
* class App extends Component { | ||
* render () { | ||
* return ( | ||
* <AdCustom | ||
* unitId='' | ||
* adIntervals={60} | ||
* onLoad={() => console.log('ad onLoad')} | ||
* onError={() => console.log('ad onError')} | ||
* onClose={() => console.log('ad onClose')} | ||
* /> | ||
* ) | ||
* } | ||
* } | ||
* ``` | ||
* @see https://developers.weixin.qq.com/miniprogram/dev/component/ad.html | ||
*/ | ||
declare const AdCustom: ComponentType<AdCustomProps> | ||
|
||
export { AdCustom, AdCustomProps } |
Oops, something went wrong.