Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support page-container #313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/miniapp-render/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [2.8.10] - 2022-11-30

### Added

- Support `page-container` native component in wechat-miniprogram

## [2.8.9] - 2022-03-23

Expand Down
2 changes: 1 addition & 1 deletion packages/miniapp-render/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miniapp-render",
"version": "2.8.9",
"version": "2.8.10",
"description": "DOM simulator for MiniApp",
"files": [
"dist"
Expand Down
4 changes: 3 additions & 1 deletion packages/miniapp-render/src/builtInComponents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import contactButton from './contact-button';

// WeChat only
import adCustom from './ad-custom';
import pageContainer from './page-container';

// Alibaba MiniApp only
import lifestyle from './lifestyle';
Expand Down Expand Up @@ -88,7 +89,8 @@ let components = [
swiperItem,
pickerViewColumn,
officialAccount,
contactButton
contactButton,
pageContainer
];

if (isWeChatMiniProgram) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
name: 'page-container'
};
2 changes: 1 addition & 1 deletion packages/miniapp-render/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const BUILTIN_COMPONENT_LIST = new Set([
if (isMiniApp) {
BUILTIN_COMPONENT_LIST.add('lifestyle').add('life-follow');
} else if (isWeChatMiniProgram) {
BUILTIN_COMPONENT_LIST.add('ad-custom');
BUILTIN_COMPONENT_LIST.add('ad-custom').add('page-container');
}

export { BUILTIN_COMPONENT_LIST };
Expand Down
6 changes: 6 additions & 0 deletions packages/rax-miniapp-runtime-webpack-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [5.0.5] - 2022-11-30

### Added

- Support `page-container` native component in wechat-miniprogram

## [5.0.4] - 2022-08-30

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion packages/rax-miniapp-runtime-webpack-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rax-miniapp-runtime-webpack-plugin",
"version": "5.0.4",
"version": "5.0.5",
"description": "A webpack plugin for miniapp runtime build",
"main": "src/index.js",
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,29 @@ const AdCustom = {
}
};

const PageContainer = {
props: {
'show': 'false',
'duration': '300',
'z-index': '100',
'overlay': 'true',
'position': addSingleQuote('bottom'),
'round': 'false',
'close-on-slide-down': 'false',
'overlay-style': '',
'custom-style': '',
},
events: {
BeforeEnter: '',
Enter: '',
AfterEnter: '',
BeforeLeave: '',
Leave: '',
AfterLeave: '',
ClickOverlay: '',
}
};

exports.internalComponents = {
View,
CatchView,
Expand Down Expand Up @@ -935,7 +958,8 @@ exports.internalComponents = {
CatchHElement,
PureHElement,
NoTouchHElement,
HComment
HComment,
PageContainer
};

exports.derivedComponents = new Map([
Expand Down Expand Up @@ -1006,7 +1030,8 @@ exports.nestElements = new Map([
['Form', 4],
['ScrollView', 4],
['Swiper', 4],
['SwiperItem', 4]
['SwiperItem', 4],
['PageContainer', 4],
]);

exports.shouldNotGenerateTemplateComponents = new Set([
Expand Down