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

[platform] tears顺心流 提交组件改动:mip-component-fulltoscreen #279

Open
wants to merge 2 commits 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
26 changes: 26 additions & 0 deletions mip-component-fulltoscreen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# mip-component-fulltoscreen

mip-component-fulltoscreen 用于当页面不足一屏时,组件节点拓展至一屏

标题|内容
----|----
类型|通用
支持布局|responsive,fixed-height,fill,container,fixed
所需脚本|https://c.mipcdn.com/static/v1/mip-component-fulltoscreen/mip-component-fulltoscreen.js

## 示例

### 基本用法
```html
<mip-component-fulltoscreen>
自定义内容,可以嵌套其他组件
</mip-component-fulltoscreen>
```

## 属性


## 注意事项

23 changes: 23 additions & 0 deletions mip-component-fulltoscreen/mip-component-fulltoscreen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* @file mip-component-fulltoscreen 组件
* @author
*/

define(function (require) {
'use strict';

var customElement = require('customElement').create();
var $ = require('jquery');

customElement.prototype.firstInviewCallback = function () {
var element = this.element;
var bodyHeight = $('body').outerHeight(true);
var windowHeight = $(window).height();
if (bodyHeight < windowHeight) {
var remainHeight = windowHeight - bodyHeight;
$(element).css('min-height', $(element).height() + remainHeight);
}
$('body').css('visibility', 'visible');
};
return customElement;
});
7 changes: 7 additions & 0 deletions mip-component-fulltoscreen/mip-component-fulltoscreen.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* @file mip-component-fulltoscreen样式文件
*/

mip-component-fulltoscreen {
// TODO
}
14 changes: 14 additions & 0 deletions mip-component-fulltoscreen/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "mip-component-fulltoscreen",
"version": "1.0.0",
"description": "用于当页面不足一屏时,组件节点拓展至一屏",
"contributors": [
{
"name": "林登峰",
"email": "[email protected]"
}
],
"engines": {
"mip": ">=1.1.0"
}
}