Merge branch 'master' of https://github.com/Tencent/omi
This commit is contained in:
commit
b25177964e
|
@ -3,14 +3,14 @@ English | [简体中文](./README.md) | [한국어](./README.KR.md)
|
|||
<p align="right">Omi <strong>v5.0.24</strong></p>
|
||||
<p align="right">Omio <strong>v1.3.8</strong></p>
|
||||
<p align="center"><img src="./assets/omi-logo2019.svg" alt="omi" width="300"/></p>
|
||||
<h2 align="center">Omi - Next generation front end framework using web components with omio(IE8+) and omip(小程序) fallback in tiny js.</h2>
|
||||
<h2 align="center">Omi - Next front end framework using web components with omio(IE8+) and omip(小程序) fallback in tiny js.</h2>
|
||||
|
||||
## Ecosystem of Omi
|
||||
|
||||
| **Project** | **Description** |
|
||||
| ------------------------------- | ----------------------------------- |
|
||||
| [omi-docs](https://github.com/Tencent/omi/blob/master/docs/main-concepts.md)| Omi official documents |
|
||||
| [omip![](https://raw.githubusercontent.com/dntzhang/cax/master/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omip)| 直接使用 Omi 开发小程序!!!|
|
||||
| [omip![](https://raw.githubusercontent.com/dntzhang/cax/master/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omip)| 直接使用 Omi 开发小程序或 H5 SPA!!!|
|
||||
| [omio![](https://raw.githubusercontent.com/dntzhang/cax/master/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omio)| Omi for old browsers(IE8+ and mobile browsers).|
|
||||
| [omiu![](https://raw.githubusercontent.com/dntzhang/cax/master/asset/hot.png)](https://tencent.github.io/omi/packages/omiu/examples/build/index.html)| Omi official UI|
|
||||
| [omix![](https://raw.githubusercontent.com/dntzhang/cax/master/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omix)| Tiny size mini programe framework.|
|
||||
|
@ -25,7 +25,7 @@ English | [简体中文](./README.md) | [한국어](./README.KR.md)
|
|||
| [omi-devtools](https://github.com/f/omi-devtools)| Browser DevTools extension |
|
||||
| [omi-cli](https://github.com/Tencent/omi/tree/master/packages/omi-cli)| Project scaffolding |
|
||||
| [omi-swiper](https://github.com/loo41/Omi-Swiper)| Omi + Swiper |
|
||||
| [omi-vscode](https://github.com/ZainChen/vscode-omi)| Vscode extension for omi, [Install now!](https://marketplace.visualstudio.com/items?itemName=ZainChen.omi) |
|
||||
| [omi-vscode](https://github.com/ZainChen/omi-vscode)| Vscode extension for omi, [Install now!](https://marketplace.visualstudio.com/items?itemName=ZainChen.omi) |
|
||||
| [omi-ex](https://github.com/Tencent/omi/tree/master/packages/omi-ex)| Omi.js extension(TypeScript) |
|
||||
| [omi-transform](https://github.com/Tencent/omi/tree/master/packages/omi-transform)|Omi / [css3transform](https://tencent.github.io/omi/packages/omi-transform/css3transform/) integration. Made css3 transform super easy in your Omi project.|
|
||||
| [omi-tap](https://github.com/Tencent/omi/releases/tag/v4.0.24)| Native tap event support(omi v4.0.24+)|
|
||||
|
@ -38,6 +38,7 @@ English | [简体中文](./README.md) | [한국어](./README.KR.md)
|
|||
|
||||
## Why Omi?
|
||||
|
||||
- One framework. Mobile & desktop & mini program.
|
||||
- Tiny size
|
||||
- Supports TypeScript
|
||||
- Reactive data-binding
|
||||
|
|
11
README.md
11
README.md
|
@ -13,7 +13,7 @@
|
|||
| **项目** | **描述** |
|
||||
| ------------------------------- | ----------------------------------- |
|
||||
| [omi-docs](https://github.com/Tencent/omi/blob/master/docs/main-concepts.cn.md)| Omi 官方文档 |
|
||||
| [omip![](https://raw.githubusercontent.com/dntzhang/cax/master/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omip)| 直接使用 Omi 开发小程序!!!|
|
||||
| [omip![](https://raw.githubusercontent.com/dntzhang/cax/master/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omip)| 直接使用 Omi 开发小程序或 H5 SPA!!!|
|
||||
| [omio![](https://raw.githubusercontent.com/dntzhang/cax/master/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omio)| 兼容老浏览器的 Omi 版本(支持到IE8+和移动端浏览器)。|
|
||||
| [omiu![](https://raw.githubusercontent.com/dntzhang/cax/master/asset/hot.png)](https://tencent.github.io/omi/packages/omiu/examples/build/zh-cn.html)| Omi 官方 UI。|
|
||||
| [omix![](https://raw.githubusercontent.com/dntzhang/cax/master/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omix)| 极小却精巧的小程序框架。|
|
||||
|
@ -25,7 +25,7 @@
|
|||
| [omi-html](https://github.com/Tencent/omi/tree/master/packages/omi-html)| Using [htm](https://github.com/developit/htm) in omi.|
|
||||
| [omi-30-seconds](https://github.com/Tencent/omi/tree/master/packages/omi-30-seconds)| 30 秒理解一段有用的 Omi 代码片段.|
|
||||
| [omi-swiper](https://github.com/loo41/Omi-Swiper)| Omi + Swiper |
|
||||
| [omi-vscode](https://github.com/ZainChen/vscode-omi)| Vscode extension for omi, [Install now!](https://marketplace.visualstudio.com/items?itemName=ZainChen.omi) |
|
||||
| [omi-vscode](https://github.com/ZainChen/omi-vscode)| Vscode extension for omi, [Install now!](https://marketplace.visualstudio.com/items?itemName=ZainChen.omi) |
|
||||
| [omi-sprite](https://github.com/Tencent/omi/tree/master/packages/omi-sprite)| Web Components, JSX 和 Canvas 的完美融合|
|
||||
| [omi-canvas](https://github.com/Tencent/omi/tree/master/packages/omi-canvas)| Web Components, JSX 和 Canvas 的完美融合|
|
||||
| [omi-router ](https://github.com/Tencent/omi/tree/master/packages/omi-router) |Omi 官方路由,超级小的尺寸,只有 1KB 的 js。[→ DEMO](https://tencent.github.io/omi/packages/omi-router/examples/spa/build/)|
|
||||
|
@ -42,6 +42,7 @@
|
|||
|
||||
### 特性
|
||||
|
||||
- 提供桌面、移动和小程序整体解决方案
|
||||
- 小巧的尺寸
|
||||
- 拥有官方 UI 组件库 - [omiu](https://tencent.github.io/omi/packages/omiu/examples/build/zh-cn.html)
|
||||
- 使用 [omio](https://github.com/Tencent/omi/tree/master/packages/omio) 可以兼容到 IE8
|
||||
|
@ -69,9 +70,12 @@
|
|||
## 必须收藏的资源
|
||||
|
||||
* [你必须收藏 ES6 Spread Operator 技巧](https://github.com/Tencent/omi/blob/master/tutorial/spread-operator.cn.md)
|
||||
* [Omi snap 骨架屏与快照](https://github.com/Tencent/omi/blob/master/tutorial/omi-snap.cn.md)
|
||||
* [Omio 兼容 IE8 踩坑之路](https://github.com/Tencent/omi/blob/master/tutorial/omio.cn.md)
|
||||
* [Omi 生态发布](https://github.com/Tencent/omi/blob/master/tutorial/ecosystem.cn.md)
|
||||
* [深入浅出 Shadow Dom](https://github.com/Tencent/omi/blob/master/tutorial/shadow-dom-in-depth.cn.md)
|
||||
* [HTM - JSX 的替代品?还是另一种选择?](https://github.com/Tencent/omi/blob/master/tutorial/omi-html.cn.md)
|
||||
* [MVVM 王者归来](https://github.com/Tencent/omi/blob/master/tutorial/omi-mvvm.cn.md)
|
||||
* [60FPS Animation In Omi](https://github.com/Tencent/omi/blob/master/tutorial/omi-transform.cn.md)
|
||||
* [Render Web Components To Native](https://github.com/Tencent/omi/blob/master/tutorial/render-web-components-to-native.cn.md)
|
||||
* [Web Components MDN](https://developer.mozilla.org/zh-CN/docs/Web/Web_Components)
|
||||
|
@ -84,7 +88,7 @@
|
|||
* [Platform HTML5](https://platform.html5.org/)
|
||||
* [使用 requestIdleCallback](https://div.io/topic/1370)
|
||||
* [A requestIdleCallback polyfill](https://gist.github.com/paullewis/55efe5d6f05434a96c36)
|
||||
* [The Power Of Web Components](https://hacks.mozilla.org/2018/11/the-power-of-web-components/)
|
||||
* [Web Components 的力量](https://github.com/Tencent/omi/blob/master/tutorial/the-power-of-web-components.cn.md)
|
||||
* [ShadowRoot](https://developer.mozilla.org/zh-CN/docs/Web/API/ShadowRoot)
|
||||
* [Developer Tools support for Web Components in Firefox 63](https://blog.nightly.mozilla.org/2018/09/06/developer-tools-support-for-web-components-in-firefox-63/)
|
||||
---
|
||||
|
@ -92,7 +96,6 @@
|
|||
# 目录
|
||||
|
||||
- [Omi 生态](#omi-生态)
|
||||
- [omi-mp](#omi-mp)
|
||||
- [必须收藏的资源](#必须收藏的资源)
|
||||
- [一个 HTML 完全上手](#一个-html-完全上手)
|
||||
- [再花 30 秒完全上手](#再花-30-秒完全上手)
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 8.7 KiB |
|
@ -232,6 +232,89 @@ const node = {
|
|||
render(<my-tree node={node} />, 'body')
|
||||
```
|
||||
|
||||
You can also use a single shadow root:
|
||||
|
||||
```js
|
||||
import { define, render, WeElement } from '../../src/omi'
|
||||
|
||||
|
||||
define('my-tree', class extends WeElement {
|
||||
open = (path) => {
|
||||
const node = this.getNodeByPath(path)
|
||||
node.open = !node.open
|
||||
this.update()
|
||||
}
|
||||
|
||||
getNodeByPath(path) {
|
||||
if (path === '#') {
|
||||
return this.props.node
|
||||
}
|
||||
const arr = path.split('-')
|
||||
arr.shift()
|
||||
let current = this.props.node
|
||||
let item
|
||||
while (item = arr.pop()) {
|
||||
current = current.children[item]
|
||||
}
|
||||
return current
|
||||
}
|
||||
|
||||
extend(path) {
|
||||
const node = this.getNodeByPath(path)
|
||||
if (!node.children) {
|
||||
node.children = [{
|
||||
name: 'new child'
|
||||
}]
|
||||
} else {
|
||||
|
||||
node.children.push({
|
||||
name: 'new child'
|
||||
})
|
||||
}
|
||||
node.open = true
|
||||
this.update()
|
||||
}
|
||||
|
||||
addChild = (path) => {
|
||||
const node = this.getNodeByPath(path)
|
||||
node.children.push({ name: 'new child' })
|
||||
this.update()
|
||||
}
|
||||
|
||||
render(props) {
|
||||
return (
|
||||
<ul>
|
||||
{this.createNode(props.node, '#')}
|
||||
</ul>
|
||||
)
|
||||
}
|
||||
|
||||
createNode(node, path) {
|
||||
const children = node.children
|
||||
const canOpen = children && children.length
|
||||
return (
|
||||
<li>
|
||||
<h4 ondblclick={e => this.extend(path)}>
|
||||
{node.name}
|
||||
{canOpen && <span onclick={e => this.open(path)}>[{node.open ? '-' : '+'}]</span>}
|
||||
</h4>
|
||||
|
||||
{canOpen && node.open && (
|
||||
<ul>
|
||||
{children.map((child, index) => {
|
||||
return this.createNode(child, path + '-' + index)
|
||||
})}
|
||||
<li class="add" onclick={e => this.addChild(path)}>
|
||||
+
|
||||
</li>
|
||||
</ul>
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### @font-face doesn't work in Shadow DOM
|
||||
|
||||
```js
|
||||
|
|
|
@ -84,7 +84,7 @@ function init(args) {
|
|||
console.log();
|
||||
console.log();
|
||||
console.log();
|
||||
success(`Congratulation! "${projectName}" has been created successful! `);
|
||||
success(`Congratulation! "${projectName}" has been created successfully! `);
|
||||
console.log();
|
||||
console.log(`${chalk.bold.cyan("Omi Chart")} https://github.com/Tencent/omi`);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ function init(args) {
|
|||
console.log();
|
||||
console.log();
|
||||
console.log();
|
||||
success(`Congratulation! "${projectName}" has been created successful! `);
|
||||
success(`Congratulation! "${projectName}" has been created successfully! `);
|
||||
console.log();
|
||||
console.log(`${chalk.bold.cyan("Omi mp")} https://github.com/Tencent/omi`);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ function init(args) {
|
|||
console.log();
|
||||
console.log();
|
||||
console.log();
|
||||
success(`Congratulation! "${projectName}" has been created successful! `);
|
||||
success(`Congratulation! "${projectName}" has been created successfully! `);
|
||||
console.log();
|
||||
console.log(`${chalk.bold.cyan("Omi MVVM")} https://github.com/Tencent/omi`);
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ function init(args) {
|
|||
console.log();
|
||||
console.log();
|
||||
console.log();
|
||||
success(`Congratulation! "${projectName}" has been created successful! `);
|
||||
success(`Congratulation! "${projectName}" has been created successfully! `);
|
||||
console.log();
|
||||
console.log(`${chalk.bold.cyan("Omio")} https://github.com/Tencent/omi`);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ function init(args) {
|
|||
console.log();
|
||||
console.log();
|
||||
console.log();
|
||||
success(`Congratulation! "${projectName}" has been created successful! `);
|
||||
success(`Congratulation! "${projectName}" has been created successfully! `);
|
||||
console.log();
|
||||
console.log(`${chalk.bold.cyan("Omi Spa")} https://github.com/Tencent/omi`);
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ Please check on https://github.com/omijs
|
|||
console.log();
|
||||
console.log();
|
||||
console.log();
|
||||
success(`Congratulation! "${projectName}" has been created successful! `);
|
||||
success(`Congratulation! "${projectName}" has been created successfully! `);
|
||||
console.log();
|
||||
console.log(`${chalk.bold.cyan("Omi " + templateName)} https://github.com/Tencent/omi`);
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ function init(args) {
|
|||
console.log();
|
||||
console.log();
|
||||
console.log();
|
||||
success(`Congratulation! "${projectName}" has been created successful! `);
|
||||
success(`Congratulation! "${projectName}" has been created successfully! `);
|
||||
console.log();
|
||||
console.log(`${chalk.bold.cyan("Omi ts")} https://github.com/Tencent/omi`);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ function init(args) {
|
|||
console.log();
|
||||
console.log();
|
||||
console.log();
|
||||
success(`Congratulation! "${projectName}" has been created successful! `);
|
||||
success(`Congratulation! "${projectName}" has been created successfully! `);
|
||||
console.log();
|
||||
console.log(`${chalk.bold.cyan("Omi weui")} https://github.com/Tencent/omi`);
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ function init(args) {
|
|||
console.log();
|
||||
console.log();
|
||||
console.log();
|
||||
success(`Congratulation! "${projectName}" has been created successful! `);
|
||||
success(`Congratulation! "${projectName}" has been created successfully! `);
|
||||
console.log();
|
||||
console.log(`${chalk.bold.cyan("Omi")} https://github.com/Tencent/omi`);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,21 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
|
||||
<style>
|
||||
body {
|
||||
font-family: Menlo, Consolas, monospace;
|
||||
color: #444;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a href="https://github.com/Tencent/omi/blob/master/packages/omi/examples/tree/main.js" target="_blank" style="position: fixed; right: 0; top: 0; z-index: 3;">
|
||||
<img src="//alloyteam.github.io/github.png" alt="">
|
||||
</a>
|
||||
<script src="b.js"></script>
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
|
@ -0,0 +1,110 @@
|
|||
import { define, render, WeElement } from '../../src/omi'
|
||||
|
||||
|
||||
define('my-tree', class extends WeElement {
|
||||
open = (path) => {
|
||||
const node = this.getNodeByPath(path)
|
||||
node.open = !node.open
|
||||
this.update()
|
||||
}
|
||||
|
||||
getNodeByPath(path) {
|
||||
if (path === '#') {
|
||||
return this.props.node
|
||||
}
|
||||
const arr = path.split('-')
|
||||
arr.shift()
|
||||
let current = this.props.node
|
||||
let item
|
||||
while (item = arr.pop()) {
|
||||
current = current.children[item]
|
||||
}
|
||||
return current
|
||||
}
|
||||
|
||||
extend(path) {
|
||||
const node = this.getNodeByPath(path)
|
||||
if (!node.children) {
|
||||
node.children = [{
|
||||
name: 'new child'
|
||||
}]
|
||||
} else {
|
||||
|
||||
node.children.push({
|
||||
name: 'new child'
|
||||
})
|
||||
}
|
||||
node.open = true
|
||||
this.update()
|
||||
}
|
||||
|
||||
addChild = (path) => {
|
||||
const node = this.getNodeByPath(path)
|
||||
node.children.push({ name: 'new child' })
|
||||
this.update()
|
||||
}
|
||||
|
||||
render(props) {
|
||||
return (
|
||||
<ul>
|
||||
{this.createNode(props.node, '#')}
|
||||
</ul>
|
||||
)
|
||||
}
|
||||
|
||||
static css = `
|
||||
h4{
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.add{
|
||||
cursor:pointer;
|
||||
}
|
||||
`
|
||||
|
||||
createNode(node, path) {
|
||||
|
||||
const children = node.children
|
||||
const canOpen = children && children.length
|
||||
return (
|
||||
<li>
|
||||
<h4 ondblclick={e => this.extend(path)}>
|
||||
{node.name}
|
||||
{canOpen && <span onclick={e => this.open(path)}>[{node.open ? '-' : '+'}]</span>}
|
||||
</h4>
|
||||
|
||||
{canOpen && node.open && (
|
||||
<ul>
|
||||
{children.map((child, index) => {
|
||||
return this.createNode(child, path + '-' + index)
|
||||
})}
|
||||
<li class="add" onclick={e => this.addChild(path)}>
|
||||
+
|
||||
</li>
|
||||
</ul>
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
const node = {
|
||||
name: 'my-tree',
|
||||
data: { x: 1 },
|
||||
open: true,
|
||||
children: [
|
||||
{
|
||||
name: 'a-1'
|
||||
},
|
||||
{
|
||||
name: 'a-2',
|
||||
children: [
|
||||
{
|
||||
name: 'a-2-1'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
render(<my-tree node={node} />, 'body')
|
|
@ -21,6 +21,7 @@
|
|||
"receive-props": "rollup -c config/rollup.example.js --watch",
|
||||
"rpx": "rollup -c config/rollup.example.js --watch",
|
||||
"tree": "rollup -c config/rollup.example.js --watch",
|
||||
"tree2": "rollup -c config/rollup.example.js --watch",
|
||||
"todo-app": "rollup -c config/rollup.example.js --watch",
|
||||
"tick": "rollup -c config/rollup.example.js --watch",
|
||||
"observe": "rollup -c config/rollup.example.js --watch",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Omip
|
||||
|
||||
使用 Omi 开发小程序
|
||||
使用 Omi 开发小程序或 H5 SPA
|
||||
|
||||
> 现在,Omi 不仅仅可以开发桌面 Web、移动 H5,还可以直接开发小程序!
|
||||
|
||||
|
@ -25,7 +25,9 @@
|
|||
npm i omi-cli -g
|
||||
omi init-p my-app
|
||||
cd my-app
|
||||
npm start
|
||||
npm start //开发小程序
|
||||
npm run dev:h5 //开发 h5
|
||||
npm run build:h5 //发布 h5
|
||||
```
|
||||
> node 版本要求 >= 8
|
||||
|
||||
|
|
|
@ -0,0 +1,107 @@
|
|||
const config = {
|
||||
projectName: 'my-app',
|
||||
date: '2019-2-21',
|
||||
designWidth: 750,
|
||||
deviceRatio: {
|
||||
'640': 2.34 / 2,
|
||||
'750': 1,
|
||||
'828': 1.81 / 2
|
||||
},
|
||||
alias: {
|
||||
'omi': 'src/libs/omip-h5/omi.esm.js',
|
||||
'@tarojs': 'src/libs'
|
||||
},
|
||||
sourceRoot: 'src',
|
||||
outputRoot: 'dist',
|
||||
plugins: {
|
||||
babel: {
|
||||
sourceMap: true,
|
||||
presets: [
|
||||
['env', {
|
||||
modules: false
|
||||
}]
|
||||
],
|
||||
plugins: [
|
||||
'transform-decorators-legacy',
|
||||
'transform-class-properties',
|
||||
'transform-object-rest-spread',
|
||||
// ['transform-react-jsx', { pragma: 'global.Omi.h' }]
|
||||
]
|
||||
}
|
||||
},
|
||||
defineConstants: {
|
||||
},
|
||||
copy: {
|
||||
patterns: [
|
||||
],
|
||||
options: {
|
||||
}
|
||||
},
|
||||
weapp: {
|
||||
module: {
|
||||
postcss: {
|
||||
autoprefixer: {
|
||||
enable: true,
|
||||
config: {
|
||||
browsers: [
|
||||
'last 3 versions',
|
||||
'Android >= 4.1',
|
||||
'ios >= 8'
|
||||
]
|
||||
}
|
||||
},
|
||||
pxtransform: {
|
||||
enable: false,
|
||||
config: {
|
||||
|
||||
}
|
||||
},
|
||||
url: {
|
||||
enable: true,
|
||||
config: {
|
||||
limit: 10240 // 设定转换尺寸上限
|
||||
}
|
||||
},
|
||||
cssModules: {
|
||||
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
||||
config: {
|
||||
namingPattern: 'module', // 转换模式,取值为 global/module
|
||||
generateScopedName: '[name]__[local]___[hash:base64:5]'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
h5: {
|
||||
publicPath: '/',
|
||||
staticDirectory: 'static',
|
||||
module: {
|
||||
postcss: {
|
||||
autoprefixer: {
|
||||
enable: true,
|
||||
config: {
|
||||
browsers: [
|
||||
'last 3 versions',
|
||||
'Android >= 4.1',
|
||||
'ios >= 8'
|
||||
]
|
||||
}
|
||||
},
|
||||
cssModules: {
|
||||
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
||||
config: {
|
||||
namingPattern: 'module', // 转换模式,取值为 global/module
|
||||
generateScopedName: '[name]__[local]___[hash:base64:5]'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function (merge) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
return merge({}, config, require('./dev'))
|
||||
}
|
||||
return merge({}, config, require('./prod'))
|
||||
}
|
|
@ -5,5 +5,7 @@ module.exports = {
|
|||
defineConstants: {
|
||||
},
|
||||
weapp: {},
|
||||
h5: {}
|
||||
h5: {
|
||||
publicPath: './',
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
"description": "",
|
||||
"scripts": {
|
||||
"build:weapp": "node ./scripts/taro-cli/bin/taro build --type weapp",
|
||||
"build:swan": "taro build --type swan",
|
||||
"build:alipay": "taro build --type alipay",
|
||||
"build:tt": "taro build --type tt",
|
||||
"build:h5": "taro build --type h5",
|
||||
"build:rn": "taro build --type rn",
|
||||
"build:swan": "node ./scripts/taro-cli/bin/taro build --type swan",
|
||||
"build:alipay": "node ./scripts/taro-cli/bin/taro build --type alipay",
|
||||
"build:tt": "node ./scripts/taro-cli/bin/taro build --type tt",
|
||||
"build:h5": "node ./scripts/taro-cli/bin/taro build --type h5",
|
||||
"build:rn": "node ./scripts/taro-cli/bin/taro build --type rn",
|
||||
"start": "npm run build:weapp -- --watch",
|
||||
"dev:swan": "npm run build:swan -- --watch",
|
||||
"dev:alipay": "npm run build:alipay -- --watch",
|
||||
|
@ -20,6 +20,8 @@
|
|||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.0.0-beta.44",
|
||||
"@fdaciuk/ajax": "^3.0.4",
|
||||
"@tarojs/components": "1.2.15",
|
||||
"@tarojs/router": "1.2.15",
|
||||
"@tarojs/taro": "1.2.15",
|
||||
|
@ -28,16 +30,23 @@
|
|||
"@tarojs/taro-swan": "1.2.15",
|
||||
"@tarojs/taro-tt": "1.2.15",
|
||||
"@tarojs/taro-weapp": "1.2.15",
|
||||
"nervjs": "^1.3.9",
|
||||
"nerv-devtools": "^1.3.9",
|
||||
"@tarojs/taroize": "1.2.13",
|
||||
"autoprefixer": "^8.4.1",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-eslint": "^8.2.3",
|
||||
"babel-generator": "^6.26.1",
|
||||
"babel-helper-evaluate-path": "^0.5.0",
|
||||
"babel-helper-mark-eval-scopes": "^0.4.3",
|
||||
"babel-helper-remove-or-void": "^0.4.3",
|
||||
"babel-plugin-danger-remove-unused-import": "^1.1.1",
|
||||
"babel-plugin-minify-dead-code": "^0.5.2",
|
||||
"babel-plugin-remove-dead-code": "^1.3.2",
|
||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
||||
"babel-plugin-transform-define": "^1.3.0",
|
||||
"babel-plugin-transform-es2015-template-literals": "^6.22.0",
|
||||
"babel-plugin-transform-flow-strip-types": "^6.22.0",
|
||||
"babel-plugin-transform-jsx-to-stylesheet": "1.2.13",
|
||||
"babel-plugin-transform-react-jsx": "^6.24.1",
|
||||
"babel-template": "^6.26.0",
|
||||
|
@ -52,9 +61,12 @@
|
|||
"css-to-react-native-transform": "^1.4.0",
|
||||
"ejs": "^2.6.1",
|
||||
"envinfo": "^6.0.1",
|
||||
"eslint": "^4.15.0",
|
||||
"eslint-plugin-taro": "1.2.13",
|
||||
"fs-extra": "^5.0.0",
|
||||
"generic-names": "^2.0.1",
|
||||
"glob": "^7.1.2",
|
||||
"html": "^1.0.0",
|
||||
"inquirer": "^5.2.0",
|
||||
"klaw": "^2.1.1",
|
||||
"latest-version": "^4.0.0",
|
||||
|
@ -62,6 +74,9 @@
|
|||
"mem-fs": "^1.1.3",
|
||||
"mem-fs-editor": "^4.0.0",
|
||||
"minimatch": "^3.0.4",
|
||||
"nerv-devtools": "^1.3.9",
|
||||
"nervjs": "^1.3.9",
|
||||
"omi-router": "^2.0.8",
|
||||
"ora": "^2.0.0",
|
||||
"postcss": "^6.0.22",
|
||||
"postcss-modules-extract-imports": "^1.1.0",
|
||||
|
@ -78,22 +93,9 @@
|
|||
"semver": "^5.5.0",
|
||||
"shelljs": "^0.8.1",
|
||||
"through2": "^2.0.3",
|
||||
"typescript": "^3.2.2",
|
||||
"vinyl": "^2.1.0",
|
||||
"vinyl-fs": "^3.0.2",
|
||||
"@babel/code-frame": "^7.0.0-beta.44",
|
||||
"babel-eslint": "^8.2.3",
|
||||
"babel-helper-evaluate-path": "^0.5.0",
|
||||
"babel-helper-mark-eval-scopes": "^0.4.3",
|
||||
"babel-helper-remove-or-void": "^0.4.3",
|
||||
"babel-plugin-minify-dead-code": "^0.5.2",
|
||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-es2015-template-literals": "^6.22.0",
|
||||
"babel-plugin-transform-flow-strip-types": "^6.22.0",
|
||||
"eslint": "^4.15.0",
|
||||
"eslint-plugin-taro": "1.2.13",
|
||||
"html": "^1.0.0",
|
||||
"typescript": "^3.2.2"
|
||||
"vinyl-fs": "^3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/webpack-env": "^1.13.6",
|
||||
|
|
|
@ -18,7 +18,9 @@ const CONFIG = require('./config')
|
|||
const { source: toAst, getObjKey } = require('./util/ast_convert')
|
||||
|
||||
const appPath = process.cwd()
|
||||
const projectConfig = require(path.join(appPath, Util.PROJECT_CONFIG))(_.merge)
|
||||
//@fix
|
||||
const projectConfig = require(path.join(appPath, Util.PROJECT_CONFIG_H5))(_.merge)
|
||||
|
||||
const h5Config = projectConfig.h5 || {}
|
||||
const routerConfig = h5Config.router || {}
|
||||
const routerMode = routerConfig.mode === 'browser' ? 'browser' : 'hash'
|
||||
|
@ -69,10 +71,21 @@ const DEVICE_RATIO = 'deviceRatio'
|
|||
if (projectConfig.hasOwnProperty(DEVICE_RATIO)) {
|
||||
pxTransformConfig[DEVICE_RATIO] = projectConfig.deviceRatio
|
||||
}
|
||||
//@fix
|
||||
if (!String.prototype.endsWith) {
|
||||
String.prototype.endsWith = function(search, this_len) {
|
||||
if (this_len === undefined || this_len > this.length) {
|
||||
this_len = this.length;
|
||||
}
|
||||
return this.substring(this_len - search.length, this_len) === search;
|
||||
};
|
||||
}
|
||||
|
||||
let pages = []
|
||||
let tabBar
|
||||
let tabbarPos
|
||||
//@fix
|
||||
let appCSS = ''
|
||||
|
||||
const FILE_TYPE = {
|
||||
ENTRY: 'ENTRY',
|
||||
|
@ -151,7 +164,8 @@ function processEntry (code, filePath) {
|
|||
)
|
||||
)
|
||||
}
|
||||
} else if (node.superClass.name === 'Component') {
|
||||
//@fix
|
||||
} else if (node.superClass.name === 'Component' || node.superClass.name === 'WeElement') {
|
||||
resetTSClassProperty(node.body.body)
|
||||
if (node.id === null) {
|
||||
const renameComponentClassName = '_TaroComponentClass'
|
||||
|
@ -199,8 +213,8 @@ function processEntry (code, filePath) {
|
|||
isIndex: k === 0
|
||||
})
|
||||
})
|
||||
|
||||
funcBody = `<Router
|
||||
//@fix
|
||||
funcBody = `<o-router
|
||||
mode={${JSON.stringify(routerMode)}}
|
||||
publicPath={${JSON.stringify(routerMode === 'hash' ? '/' : publicPath)}}
|
||||
routes={[${routes.join(',')}]}
|
||||
|
@ -256,9 +270,9 @@ function processEntry (code, filePath) {
|
|||
astPath.get('body').pushContainer('body', initTabBarApisCallNode)
|
||||
}
|
||||
|
||||
if (hasConstructor && isConstructor) {
|
||||
astPath.get('body').pushContainer('body', additionalConstructorNode)
|
||||
}
|
||||
// if (hasConstructor && isConstructor) {
|
||||
// astPath.get('body').pushContainer('body', additionalConstructorNode)
|
||||
// }
|
||||
|
||||
if (hasComponentDidShow && isComponentDidMount) {
|
||||
const componentDidShowCallNode = toAst(`this.componentDidShow()`)
|
||||
|
@ -295,11 +309,12 @@ function processEntry (code, filePath) {
|
|||
'method', t.identifier('componentWillUnmount'), [],
|
||||
t.blockStatement([]), false, false))
|
||||
}
|
||||
if (!hasConstructor) {
|
||||
astPath.pushContainer('body', t.classMethod(
|
||||
'method', t.identifier('constructor'), [t.identifier('props'), t.identifier('context')],
|
||||
t.blockStatement([toAst('super(props, context)'), additionalConstructorNode]), false, false))
|
||||
}
|
||||
//@fix
|
||||
// if (!hasConstructor) {
|
||||
// astPath.pushContainer('body', t.classMethod(
|
||||
// 'method', t.identifier('constructor'), [t.identifier('props'), t.identifier('context')],
|
||||
// t.blockStatement([toAst('super(props, context)'), additionalConstructorNode]), false, false))
|
||||
// }
|
||||
if (tabBar) {
|
||||
if (!hasComponentWillMount) {
|
||||
astPath.pushContainer('body', t.classMethod(
|
||||
|
@ -376,6 +391,13 @@ function processEntry (code, filePath) {
|
|||
const source = node.source
|
||||
const specifiers = node.specifiers
|
||||
let value = source.value
|
||||
//@fix
|
||||
if(value.endsWith('.css')){
|
||||
appCSS = fs.readFileSync(filePath.replace('.tsx','.css').replace('.js','.css'), 'utf-8').replace(/\/\*[^*]*\*+([^/][^*]*\*+)*\//g, '')
|
||||
// astPath.replaceWith(t.variableDeclaration('const',[t.variableDeclarator(t.identifier(`___css`),t.stringLiteral(appCSS))]))
|
||||
astPath.remove()
|
||||
return
|
||||
}
|
||||
if (Util.isAliasPath(value, pathAlias)) {
|
||||
source.value = value = Util.replaceAliasPath(filePath, value, pathAlias)
|
||||
}
|
||||
|
@ -402,9 +424,10 @@ function processEntry (code, filePath) {
|
|||
specifier.local.name = nervJsImportDefaultName
|
||||
} else if (!hasAddNervJsImportDefaultName) {
|
||||
hasAddNervJsImportDefaultName = true
|
||||
node.specifiers.unshift(
|
||||
t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
)
|
||||
//@fix
|
||||
// node.specifiers.unshift(
|
||||
// t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
// )
|
||||
}
|
||||
const taroApisSpecifiers = []
|
||||
const deletedIdx = []
|
||||
|
@ -511,21 +534,27 @@ function processEntry (code, filePath) {
|
|||
Program: {
|
||||
exit (astPath) {
|
||||
const importNervjsNode = t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
const importRouterNode = toAst(`import { Router } from '${PACKAGES['@tarojs/router']}'`)
|
||||
const importRouterNode = toAst(`import '${PACKAGES['@tarojs/router']}'`)
|
||||
//@fix
|
||||
const importMpNode = toAst(`import './libs/mp'`)
|
||||
const importTaroH5Node = toAst(`import ${taroImportDefaultName} from '${PACKAGES['@tarojs/taro-h5']}'`)
|
||||
const importComponentNode = toAst(`import { View, ${tabBarComponentName}, ${tabBarContainerComponentName}, ${tabBarPanelComponentName}} from '${PACKAGES['@tarojs/components']}'`)
|
||||
const lastImportIndex = _.findLastIndex(astPath.node.body, t.isImportDeclaration)
|
||||
const lastImportNode = astPath.get(`body.${lastImportIndex > -1 ? lastImportIndex : 0}`)
|
||||
const extraNodes = [
|
||||
importTaroH5Node,
|
||||
//@fix
|
||||
//importTaroH5Node,
|
||||
importMpNode,
|
||||
importRouterNode,
|
||||
initPxTransformNode
|
||||
//@fix
|
||||
//initPxTransformNode
|
||||
]
|
||||
|
||||
astPath.traverse(programExitVisitor)
|
||||
|
||||
if (hasJSX && !hasAddNervJsImportDefaultName) {
|
||||
extraNodes.unshift(importNervjsNode)
|
||||
//@fix
|
||||
//extraNodes.unshift(importNervjsNode)
|
||||
}
|
||||
if (tabBar) {
|
||||
extraNodes.unshift(importComponentNode)
|
||||
|
@ -591,7 +620,8 @@ function processOthers (code, filePath, fileType) {
|
|||
)
|
||||
)
|
||||
}
|
||||
} else if (node.superClass.name === 'Component') {
|
||||
//@fix
|
||||
} else if (node.superClass.name === 'Component' || node.superClass.name === 'WeElement') {
|
||||
resetTSClassProperty(node.body.body)
|
||||
if (node.id === null) {
|
||||
const renameComponentClassName = '_TaroComponentClass'
|
||||
|
@ -621,6 +651,11 @@ function processOthers (code, filePath, fileType) {
|
|||
'method', t.identifier('componentDidShow'), [],
|
||||
t.blockStatement([]), false, false))
|
||||
}
|
||||
//@fix
|
||||
astPath.unshiftContainer('body', t.classProperty(
|
||||
t.identifier('static css'),
|
||||
t.identifier('___css')
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -640,12 +675,31 @@ function processOthers (code, filePath, fileType) {
|
|||
}
|
||||
}
|
||||
} : {},
|
||||
//@fix
|
||||
ClassBody:{
|
||||
enter (astPath) {
|
||||
astPath.unshiftContainer('body', t.classProperty(
|
||||
t.identifier('static css'),
|
||||
t.identifier('___css')
|
||||
))
|
||||
}
|
||||
},
|
||||
ImportDeclaration: {
|
||||
enter (astPath) {
|
||||
const node = astPath.node
|
||||
const source = node.source
|
||||
let value = source.value
|
||||
const specifiers = node.specifiers
|
||||
//@fix
|
||||
if(value.endsWith('.css')){
|
||||
let css = fs.readFileSync(filePath.replace('.tsx','.css').replace('.js','.css'), 'utf-8').replace(/\/\*[^*]*\*+([^/][^*]*\*+)*\//g, '')
|
||||
//page里需要注入 appcss
|
||||
if(filePath.indexOf('/src/pages/')!==-1||filePath.indexOf('\\src\\pages\\')!==-1){
|
||||
css = appCSS + css
|
||||
}
|
||||
astPath.replaceWith(t.variableDeclaration('const',[t.variableDeclarator(t.identifier(`___css`),t.callExpression(t.identifier('Omi.rpx'),[t.stringLiteral(css)]),)]))
|
||||
return
|
||||
}
|
||||
if (Util.isAliasPath(value, pathAlias)) {
|
||||
source.value = value = Util.replaceAliasPath(filePath, value, pathAlias)
|
||||
}
|
||||
|
@ -664,10 +718,11 @@ function processOthers (code, filePath, fileType) {
|
|||
taroImportDefaultName = specifier.local.name
|
||||
specifier.local.name = nervJsImportDefaultName
|
||||
} else if (!hasAddNervJsImportDefaultName) {
|
||||
hasAddNervJsImportDefaultName = true
|
||||
node.specifiers.unshift(
|
||||
t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
)
|
||||
//@fix
|
||||
//hasAddNervJsImportDefaultName = true
|
||||
// node.specifiers.unshift(
|
||||
// t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
// )
|
||||
}
|
||||
const taroApisSpecifiers = []
|
||||
const deletedIdx = []
|
||||
|
@ -705,11 +760,12 @@ function processOthers (code, filePath, fileType) {
|
|||
}
|
||||
const node = astPath.node
|
||||
if (hasJSX && !hasAddNervJsImportDefaultName) {
|
||||
node.body.unshift(
|
||||
t.importDeclaration([
|
||||
t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
], t.stringLiteral(PACKAGES['nervjs']))
|
||||
)
|
||||
//@fix
|
||||
// node.body.unshift(
|
||||
// t.importDeclaration([
|
||||
// t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
// ], t.stringLiteral(PACKAGES['nervjs']))
|
||||
// )
|
||||
}
|
||||
if (taroImportDefaultName) {
|
||||
const importTaro = toAst(`import ${taroImportDefaultName} from '${PACKAGES['@tarojs/taro-h5']}'`)
|
||||
|
|
|
@ -163,6 +163,8 @@ exports.CONFIG_MAP = {
|
|||
}
|
||||
|
||||
exports.PROJECT_CONFIG = 'config/index.js'
|
||||
//@fix
|
||||
exports.PROJECT_CONFIG_H5 = 'config/h5.js'
|
||||
|
||||
exports.DEVICE_RATIO = {
|
||||
'640': 2.34 / 2,
|
||||
|
|
|
@ -74,4 +74,4 @@ define('my-app', class extends WeElement {
|
|||
})
|
||||
|
||||
|
||||
render(<my-app />, 'body')
|
||||
render(<my-app />, '#app')
|
||||
|
|
|
@ -1,23 +1,29 @@
|
|||
import { WeElement, define } from 'omi'
|
||||
|
||||
|
||||
interface IData {
|
||||
arr: Array<any>
|
||||
}
|
||||
|
||||
|
||||
define('my-element', class extends WeElement {
|
||||
a = 1
|
||||
|
||||
data = {
|
||||
data: IData = {
|
||||
arr: ['item1', 'item2']
|
||||
}
|
||||
|
||||
clickHandler = () => {
|
||||
console.log('clicked' + this.a)
|
||||
|
||||
// this.data.arr[0] = Math.random()
|
||||
// this.data.arr[1] = Math.random()
|
||||
// this.update()
|
||||
//上面代码等同于:
|
||||
this.update({
|
||||
'arr[0]': Math.random(),
|
||||
"arr[1]": Math.random()
|
||||
})
|
||||
this.data.arr[0] = Math.random()
|
||||
this.data.arr[1] = Math.random()
|
||||
this.update()
|
||||
//上面代码等同于,注意 h5 不能使用下面的方式
|
||||
// this.update({
|
||||
// 'arr[0]': Math.random(),
|
||||
// "arr[1]": Math.random()
|
||||
// })
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
window.getApp = function () {
|
||||
return {
|
||||
globalData: {
|
||||
userInfo: {
|
||||
avatarUrl: 'https://github.com/Tencent/omi/raw/master/assets/omi-logo-140.png?sanitize=true',
|
||||
nickName: 'dntzhang(张磊)'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
import './wx'
|
||||
import './get-app'
|
|
@ -0,0 +1,182 @@
|
|||
import { render } from 'omi'
|
||||
import ajax from '@fdaciuk/ajax'
|
||||
|
||||
|
||||
function noop() { }
|
||||
|
||||
const wx = {}
|
||||
|
||||
wx.canIUse = function () {
|
||||
return false
|
||||
}
|
||||
|
||||
wx.getStorageSync = noop
|
||||
wx.setStorageSync = noop
|
||||
wx.login = noop
|
||||
wx.getSetting = noop
|
||||
|
||||
wx.getSystemInfoSync = function () {
|
||||
return {
|
||||
windowWidth: window.innerWidth,
|
||||
windowHeight: window.innerHeight,
|
||||
pixelRatio: window.devicePixelRadio
|
||||
}
|
||||
}
|
||||
|
||||
wx.getSystemInfo = function (options) {
|
||||
options.success({
|
||||
windowWidth: window.innerWidth,
|
||||
windowHeight: window.innerHeight,
|
||||
pixelRatio: window.devicePixelRadio
|
||||
})
|
||||
}
|
||||
|
||||
wx.getUserInfo = function () {
|
||||
console.warn('wx.getUserInfo method cannot be invoked in browser.')
|
||||
}
|
||||
|
||||
wx.navigateTo = function (option) {
|
||||
route.query = getUrlParams(option.url)
|
||||
route.to(option.url.replace('../','/pages/'), option)
|
||||
}
|
||||
|
||||
function getUrlParam(name, url) {
|
||||
if (!name) {
|
||||
return ''
|
||||
}
|
||||
url = url || location.search
|
||||
name = name.replace(/(?=[\\^$*+?.():|{}])/, '\\')
|
||||
var reg = new RegExp('(?:[?&]|^)' + name + '=([^?&#]*)', 'i')
|
||||
var match = url.match(reg)
|
||||
return !match ? '' : match[1]
|
||||
}
|
||||
|
||||
wx.setNavigationBarTitle = function (option) {
|
||||
document.title = option.title
|
||||
}
|
||||
|
||||
wx.navigateBack = function (option) {
|
||||
history.go(option.delta * -1)
|
||||
}
|
||||
|
||||
function getUrlParams(url) {
|
||||
url = url.replace(/#.*$/, '')
|
||||
var queryArray = url.split(/[?&]/).slice(1)
|
||||
var i, args = {}
|
||||
for (i = 0; i < queryArray.length; i++) {
|
||||
var match = queryArray[i].match(/([^=]+)=([^=]+)/)
|
||||
if (match !== null) {
|
||||
args[match[1]] = decodeURIComponent(match[2])
|
||||
}
|
||||
}
|
||||
return args
|
||||
}
|
||||
|
||||
wx.currentPage = null
|
||||
|
||||
export function routeUpdate(vnode, selector, byNative, root) {
|
||||
root.childNodes.forEach(child => {
|
||||
if (child.style.display !== 'none') {
|
||||
child.style.display = 'none'
|
||||
child.onHide && child.onHide()
|
||||
}
|
||||
})
|
||||
if (byNative) {
|
||||
const ele = document.querySelector(selector)
|
||||
if (ele) {
|
||||
ele.style.display = 'block'
|
||||
ele.onShow && ele.onShow()
|
||||
wx.currentPage = ele
|
||||
document.documentElement.scrollTop = ele._preScrollTop
|
||||
document.body.scrollTop = ele._preScrollTop
|
||||
//set twice
|
||||
setTimeout(function () {
|
||||
document.documentElement.scrollTop = ele._preScrollTop
|
||||
document.body.scrollTop = ele._preScrollTop
|
||||
}, 0)
|
||||
} else {
|
||||
const node = render(vnode, root)
|
||||
node.onShow && node.onShow()
|
||||
wx.currentPage = node
|
||||
document.documentElement.scrollTop = 0
|
||||
document.body.scrollTop = 0
|
||||
}
|
||||
} else {
|
||||
const ele = document.querySelector(selector)
|
||||
ele && ele.parentNode.removeChild(ele)
|
||||
const node = render(vnode, root)
|
||||
node.onShow && node.onShow()
|
||||
wx.currentPage = node
|
||||
document.documentElement.scrollTop = 0
|
||||
document.body.scrollTop = 0
|
||||
}
|
||||
}
|
||||
|
||||
wx.request = function (options) {
|
||||
const request = ajax({
|
||||
method: options.method || 'GET',
|
||||
url: options.url,
|
||||
data: options.data,
|
||||
headers: options.header
|
||||
})
|
||||
|
||||
request.then((data, xhr) => {
|
||||
options.success({
|
||||
data: data,
|
||||
statusCode: xhr.status
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
wx._bindReachBottom = function (callback, context) {
|
||||
window.addEventListener('scroll', () => {
|
||||
if (getScrollHeight() - getScrollTop() - getWindowHeight() < 30) {
|
||||
if(context === wx.currentPage){
|
||||
throttle(callback, context)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getScrollHeight() {
|
||||
var scrollHeight = 0, bodyScrollHeight = 0, documentScrollHeight = 0;
|
||||
if (document.body) {
|
||||
bodyScrollHeight = document.body.scrollHeight;
|
||||
}
|
||||
if (document.documentElement) {
|
||||
documentScrollHeight = document.documentElement.scrollHeight;
|
||||
}
|
||||
scrollHeight = (bodyScrollHeight - documentScrollHeight > 0) ? bodyScrollHeight : documentScrollHeight;
|
||||
return scrollHeight;
|
||||
}
|
||||
|
||||
function getScrollTop() {
|
||||
var scrollTop = 0, bodyScrollTop = 0, documentScrollTop = 0;
|
||||
if (document.body) {
|
||||
bodyScrollTop = document.body.scrollTop;
|
||||
}
|
||||
if (document.documentElement) {
|
||||
documentScrollTop = document.documentElement.scrollTop;
|
||||
}
|
||||
scrollTop = (bodyScrollTop - documentScrollTop > 0) ? bodyScrollTop : documentScrollTop;
|
||||
return scrollTop;
|
||||
}
|
||||
|
||||
function getWindowHeight() {
|
||||
var windowHeight = 0;
|
||||
if (document.compatMode == "CSS1Compat") {
|
||||
windowHeight = document.documentElement.clientHeight;
|
||||
} else {
|
||||
windowHeight = document.body.clientHeight;
|
||||
}
|
||||
return windowHeight;
|
||||
}
|
||||
|
||||
function throttle(method, scope) {
|
||||
clearTimeout(method.tId);
|
||||
method.tId= setTimeout(function(){
|
||||
method.call(scope);
|
||||
}, 300);
|
||||
}
|
||||
|
||||
window.wx = wx
|
|
@ -0,0 +1,976 @@
|
|||
export = Omi;
|
||||
export as namespace Omi;
|
||||
|
||||
declare namespace Omi {
|
||||
type Callback = (...args: any[]) => void;
|
||||
type Key = string | number;
|
||||
type Ref<T> = (instance: T) => void;
|
||||
type ComponentChild = VNode<any> | object | string | number | boolean | null;
|
||||
type ComponentChildren = ComponentChild[] | ComponentChild;
|
||||
|
||||
interface Attributes {
|
||||
key?: string | number | any;
|
||||
}
|
||||
|
||||
interface ClassAttributes<T> extends Attributes {
|
||||
ref?: Ref<T>;
|
||||
}
|
||||
|
||||
interface OmiDOMAttributes {
|
||||
children?: ComponentChildren;
|
||||
dangerouslySetInnerHTML?: {
|
||||
__html: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this to manually set the attributes of a custom element
|
||||
*
|
||||
* declare global {
|
||||
* namespace JSX {
|
||||
* interface IntrinsicElements {
|
||||
* 'hello-element': CustomElementBaseAttributes & {
|
||||
* propFromParent: string;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
interface CustomElementBaseAttributes extends ClassAttributes<any>, OmiDOMAttributes {}
|
||||
|
||||
/**
|
||||
* Define the contract for a virtual node in omi.
|
||||
*
|
||||
* A virtual node has a name, a map of attributes, an array
|
||||
* of child {VNode}s and a key. The key is used by omi for
|
||||
* internal purposes.
|
||||
*/
|
||||
interface VNode<P = any> {
|
||||
nodeName: string;
|
||||
attributes: P;
|
||||
children: Array<VNode<any> | string>;
|
||||
key?: Key | null;
|
||||
}
|
||||
|
||||
type RenderableProps<P, RefType = any> = Readonly<
|
||||
P & Attributes & { children?: ComponentChildren; ref?: Ref<RefType> }
|
||||
>;
|
||||
|
||||
interface WeElement<P, D> {
|
||||
install?(): void;
|
||||
installed?(): void;
|
||||
uninstall?(): void;
|
||||
beforeUpdate?(): void;
|
||||
afterUpdate?(): void;
|
||||
updated?(): void;
|
||||
beforeRender?(): void;
|
||||
receiveProps?(): void;
|
||||
}
|
||||
|
||||
interface ModelView<P, D> {
|
||||
install?(): void;
|
||||
installed?(): void;
|
||||
uninstall?(): void;
|
||||
beforeUpdate?(): void;
|
||||
afterUpdate?(): void;
|
||||
updated?(): void;
|
||||
beforeRender?(): void;
|
||||
receiveProps?(): void;
|
||||
}
|
||||
|
||||
interface Component<P, D> {
|
||||
install?(): void;
|
||||
installed?(): void;
|
||||
uninstall?(): void;
|
||||
beforeUpdate?(): void;
|
||||
afterUpdate?(): void;
|
||||
updated?(): void;
|
||||
beforeRender?(): void;
|
||||
receiveProps?(): void;
|
||||
}
|
||||
|
||||
abstract class WeElement<P = {}, D = {}> {
|
||||
constructor();
|
||||
|
||||
// Allow static members to reference class type parameters
|
||||
// https://github.com/Microsoft/TypeScript/issues/24018
|
||||
static props: object;
|
||||
static data: object;
|
||||
static observe: boolean;
|
||||
static mergeUpdate: boolean;
|
||||
static css: string;
|
||||
|
||||
props: RenderableProps<P>;
|
||||
data: D;
|
||||
host: HTMLElement;
|
||||
|
||||
update(): void;
|
||||
fire(name: string, data?: object): void;
|
||||
|
||||
// Abstract methods don't infer argument types
|
||||
// https://github.com/Microsoft/TypeScript/issues/14887
|
||||
abstract render(props: RenderableProps<P>, data: D): void;
|
||||
}
|
||||
|
||||
// The class type (not instance of class)
|
||||
// https://stackoverflow.com/q/42753968/2777142
|
||||
interface WeElementConstructor {
|
||||
new(): WeElement;
|
||||
}
|
||||
|
||||
abstract class ModelView<P = {}, D = {}> {
|
||||
constructor();
|
||||
|
||||
// Allow static members to reference class type parameters
|
||||
// https://github.com/Microsoft/TypeScript/issues/24018
|
||||
static props: object;
|
||||
static data: object;
|
||||
static observe: boolean;
|
||||
static mergeUpdate: boolean;
|
||||
|
||||
props: RenderableProps<P>;
|
||||
data: D;
|
||||
host: HTMLElement;
|
||||
|
||||
update(): void;
|
||||
fire(name: string, data?: object): void;
|
||||
|
||||
// Abstract methods don't infer argument types
|
||||
// https://github.com/Microsoft/TypeScript/issues/14887
|
||||
abstract render(props: RenderableProps<P>, data: D): void;
|
||||
}
|
||||
|
||||
abstract class Component<P = {}, D = {}> {
|
||||
constructor();
|
||||
|
||||
// Allow static members to reference class type parameters
|
||||
// https://github.com/Microsoft/TypeScript/issues/24018
|
||||
static props: object;
|
||||
static data: object;
|
||||
static observe: boolean;
|
||||
static mergeUpdate: boolean;
|
||||
static css: string;
|
||||
|
||||
props: RenderableProps<P>;
|
||||
data: D;
|
||||
host: HTMLElement;
|
||||
|
||||
update(): void;
|
||||
fire(name: string, data?: object): void;
|
||||
|
||||
// Abstract methods don't infer argument types
|
||||
// https://github.com/Microsoft/TypeScript/issues/14887
|
||||
abstract render(props: RenderableProps<P>, data: D): void;
|
||||
}
|
||||
|
||||
function h<P>(
|
||||
node: string,
|
||||
params: Attributes & P | null,
|
||||
...children: ComponentChildren[]
|
||||
): VNode<any>;
|
||||
function h(
|
||||
node: string,
|
||||
params: JSX.HTMLAttributes & JSX.SVGAttributes & Record<string, any> | null,
|
||||
...children: ComponentChildren[]
|
||||
): VNode<any>;
|
||||
|
||||
function render(vnode: ComponentChild, parent: string | Element | Document | ShadowRoot | DocumentFragment, store?: object, empty?: boolean, merge?: string | Element | Document | ShadowRoot | DocumentFragment): void;
|
||||
|
||||
function define(name: string, ctor: WeElementConstructor): void;
|
||||
function tag(name: string, pure?: boolean): (ctor: WeElementConstructor) => void;
|
||||
function tick(callback: Callback, scope?: any): void;
|
||||
function nextTick(callback: Callback, scope?: any): void;
|
||||
function observe(target: WeElementConstructor): void;
|
||||
function getHost(element: WeElement): WeElement;
|
||||
|
||||
var options: {
|
||||
vnode?: (vnode: VNode<any>) => void;
|
||||
event?: (event: Event) => Event;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
type Defaultize<Props, Defaults> =
|
||||
// Distribute over unions
|
||||
Props extends any
|
||||
? // Make any properties included in Default optional
|
||||
& Partial<Pick<Props, Extract<keyof Props, keyof Defaults>>>
|
||||
// Include the remaining properties from Props
|
||||
& Pick<Props, Exclude<keyof Props, keyof Defaults>>
|
||||
: never;
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
interface Element extends Omi.VNode<any> {
|
||||
}
|
||||
|
||||
interface ElementClass extends Omi.WeElement<any, any> {
|
||||
}
|
||||
|
||||
interface ElementClass extends Omi.Component<any, any> {
|
||||
}
|
||||
|
||||
interface ElementAttributesProperty {
|
||||
props: any;
|
||||
}
|
||||
|
||||
interface ElementChildrenAttribute {
|
||||
children: any;
|
||||
}
|
||||
|
||||
type LibraryManagedAttributes<Component, Props> =
|
||||
Component extends { defaultProps: infer Defaults }
|
||||
? Defaultize<Props, Defaults>
|
||||
: Props;
|
||||
|
||||
interface SVGAttributes extends HTMLAttributes {
|
||||
accentHeight?: number | string;
|
||||
accumulate?: "none" | "sum";
|
||||
additive?: "replace" | "sum";
|
||||
alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit";
|
||||
allowReorder?: "no" | "yes";
|
||||
alphabetic?: number | string;
|
||||
amplitude?: number | string;
|
||||
arabicForm?: "initial" | "medial" | "terminal" | "isolated";
|
||||
ascent?: number | string;
|
||||
attributeName?: string;
|
||||
attributeType?: string;
|
||||
autoReverse?: number | string;
|
||||
azimuth?: number | string;
|
||||
baseFrequency?: number | string;
|
||||
baselineShift?: number | string;
|
||||
baseProfile?: number | string;
|
||||
bbox?: number | string;
|
||||
begin?: number | string;
|
||||
bias?: number | string;
|
||||
by?: number | string;
|
||||
calcMode?: number | string;
|
||||
capHeight?: number | string;
|
||||
clip?: number | string;
|
||||
clipPath?: string;
|
||||
clipPathUnits?: number | string;
|
||||
clipRule?: number | string;
|
||||
colorInterpolation?: number | string;
|
||||
colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit";
|
||||
colorProfile?: number | string;
|
||||
colorRendering?: number | string;
|
||||
contentScriptType?: number | string;
|
||||
contentStyleType?: number | string;
|
||||
cursor?: number | string;
|
||||
cx?: number | string;
|
||||
cy?: number | string;
|
||||
d?: string;
|
||||
decelerate?: number | string;
|
||||
descent?: number | string;
|
||||
diffuseConstant?: number | string;
|
||||
direction?: number | string;
|
||||
display?: number | string;
|
||||
divisor?: number | string;
|
||||
dominantBaseline?: number | string;
|
||||
dur?: number | string;
|
||||
dx?: number | string;
|
||||
dy?: number | string;
|
||||
edgeMode?: number | string;
|
||||
elevation?: number | string;
|
||||
enableBackground?: number | string;
|
||||
end?: number | string;
|
||||
exponent?: number | string;
|
||||
externalResourcesRequired?: number | string;
|
||||
fill?: string;
|
||||
fillOpacity?: number | string;
|
||||
fillRule?: "nonzero" | "evenodd" | "inherit";
|
||||
filter?: string;
|
||||
filterRes?: number | string;
|
||||
filterUnits?: number | string;
|
||||
floodColor?: number | string;
|
||||
floodOpacity?: number | string;
|
||||
focusable?: number | string;
|
||||
fontFamily?: string;
|
||||
fontSize?: number | string;
|
||||
fontSizeAdjust?: number | string;
|
||||
fontStretch?: number | string;
|
||||
fontStyle?: number | string;
|
||||
fontVariant?: number | string;
|
||||
fontWeight?: number | string;
|
||||
format?: number | string;
|
||||
from?: number | string;
|
||||
fx?: number | string;
|
||||
fy?: number | string;
|
||||
g1?: number | string;
|
||||
g2?: number | string;
|
||||
glyphName?: number | string;
|
||||
glyphOrientationHorizontal?: number | string;
|
||||
glyphOrientationVertical?: number | string;
|
||||
glyphRef?: number | string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: string;
|
||||
hanging?: number | string;
|
||||
horizAdvX?: number | string;
|
||||
horizOriginX?: number | string;
|
||||
ideographic?: number | string;
|
||||
imageRendering?: number | string;
|
||||
in2?: number | string;
|
||||
in?: string;
|
||||
intercept?: number | string;
|
||||
k1?: number | string;
|
||||
k2?: number | string;
|
||||
k3?: number | string;
|
||||
k4?: number | string;
|
||||
k?: number | string;
|
||||
kernelMatrix?: number | string;
|
||||
kernelUnitLength?: number | string;
|
||||
kerning?: number | string;
|
||||
keyPoints?: number | string;
|
||||
keySplines?: number | string;
|
||||
keyTimes?: number | string;
|
||||
lengthAdjust?: number | string;
|
||||
letterSpacing?: number | string;
|
||||
lightingColor?: number | string;
|
||||
limitingConeAngle?: number | string;
|
||||
local?: number | string;
|
||||
markerEnd?: string;
|
||||
markerHeight?: number | string;
|
||||
markerMid?: string;
|
||||
markerStart?: string;
|
||||
markerUnits?: number | string;
|
||||
markerWidth?: number | string;
|
||||
mask?: string;
|
||||
maskContentUnits?: number | string;
|
||||
maskUnits?: number | string;
|
||||
mathematical?: number | string;
|
||||
mode?: number | string;
|
||||
numOctaves?: number | string;
|
||||
offset?: number | string;
|
||||
opacity?: number | string;
|
||||
operator?: number | string;
|
||||
order?: number | string;
|
||||
orient?: number | string;
|
||||
orientation?: number | string;
|
||||
origin?: number | string;
|
||||
overflow?: number | string;
|
||||
overlinePosition?: number | string;
|
||||
overlineThickness?: number | string;
|
||||
paintOrder?: number | string;
|
||||
panose1?: number | string;
|
||||
pathLength?: number | string;
|
||||
patternContentUnits?: string;
|
||||
patternTransform?: number | string;
|
||||
patternUnits?: string;
|
||||
pointerEvents?: number | string;
|
||||
points?: string;
|
||||
pointsAtX?: number | string;
|
||||
pointsAtY?: number | string;
|
||||
pointsAtZ?: number | string;
|
||||
preserveAlpha?: number | string;
|
||||
preserveAspectRatio?: string;
|
||||
primitiveUnits?: number | string;
|
||||
r?: number | string;
|
||||
radius?: number | string;
|
||||
refX?: number | string;
|
||||
refY?: number | string;
|
||||
renderingIntent?: number | string;
|
||||
repeatCount?: number | string;
|
||||
repeatDur?: number | string;
|
||||
requiredExtensions?: number | string;
|
||||
requiredFeatures?: number | string;
|
||||
restart?: number | string;
|
||||
result?: string;
|
||||
rotate?: number | string;
|
||||
rx?: number | string;
|
||||
ry?: number | string;
|
||||
scale?: number | string;
|
||||
seed?: number | string;
|
||||
shapeRendering?: number | string;
|
||||
slope?: number | string;
|
||||
spacing?: number | string;
|
||||
specularConstant?: number | string;
|
||||
specularExponent?: number | string;
|
||||
speed?: number | string;
|
||||
spreadMethod?: string;
|
||||
startOffset?: number | string;
|
||||
stdDeviation?: number | string;
|
||||
stemh?: number | string;
|
||||
stemv?: number | string;
|
||||
stitchTiles?: number | string;
|
||||
stopColor?: string;
|
||||
stopOpacity?: number | string;
|
||||
strikethroughPosition?: number | string;
|
||||
strikethroughThickness?: number | string;
|
||||
string?: number | string;
|
||||
stroke?: string;
|
||||
strokeDasharray?: string | number;
|
||||
strokeDashoffset?: string | number;
|
||||
strokeLinecap?: "butt" | "round" | "square" | "inherit";
|
||||
strokeLinejoin?: "miter" | "round" | "bevel" | "inherit";
|
||||
strokeMiterlimit?: string;
|
||||
strokeOpacity?: number | string;
|
||||
strokeWidth?: number | string;
|
||||
surfaceScale?: number | string;
|
||||
systemLanguage?: number | string;
|
||||
tableValues?: number | string;
|
||||
targetX?: number | string;
|
||||
targetY?: number | string;
|
||||
textAnchor?: string;
|
||||
textDecoration?: number | string;
|
||||
textLength?: number | string;
|
||||
textRendering?: number | string;
|
||||
to?: number | string;
|
||||
transform?: string;
|
||||
u1?: number | string;
|
||||
u2?: number | string;
|
||||
underlinePosition?: number | string;
|
||||
underlineThickness?: number | string;
|
||||
unicode?: number | string;
|
||||
unicodeBidi?: number | string;
|
||||
unicodeRange?: number | string;
|
||||
unitsPerEm?: number | string;
|
||||
vAlphabetic?: number | string;
|
||||
values?: string;
|
||||
vectorEffect?: number | string;
|
||||
version?: string;
|
||||
vertAdvY?: number | string;
|
||||
vertOriginX?: number | string;
|
||||
vertOriginY?: number | string;
|
||||
vHanging?: number | string;
|
||||
vIdeographic?: number | string;
|
||||
viewBox?: string;
|
||||
viewTarget?: number | string;
|
||||
visibility?: number | string;
|
||||
vMathematical?: number | string;
|
||||
widths?: number | string;
|
||||
wordSpacing?: number | string;
|
||||
writingMode?: number | string;
|
||||
x1?: number | string;
|
||||
x2?: number | string;
|
||||
x?: number | string;
|
||||
xChannelSelector?: string;
|
||||
xHeight?: number | string;
|
||||
xlinkActuate?: string;
|
||||
xlinkArcrole?: string;
|
||||
xlinkHref?: string;
|
||||
xlinkRole?: string;
|
||||
xlinkShow?: string;
|
||||
xlinkTitle?: string;
|
||||
xlinkType?: string;
|
||||
xmlBase?: string;
|
||||
xmlLang?: string;
|
||||
xmlns?: string;
|
||||
xmlnsXlink?: string;
|
||||
xmlSpace?: string;
|
||||
y1?: number | string;
|
||||
y2?: number | string;
|
||||
y?: number | string;
|
||||
yChannelSelector?: string;
|
||||
z?: number | string;
|
||||
zoomAndPan?: string;
|
||||
}
|
||||
|
||||
interface PathAttributes {
|
||||
d: string;
|
||||
}
|
||||
|
||||
interface EventHandler<E extends Event> {
|
||||
(event: E): void;
|
||||
}
|
||||
|
||||
type ClipboardEventHandler = EventHandler<ClipboardEvent>;
|
||||
type CompositionEventHandler = EventHandler<CompositionEvent>;
|
||||
type DragEventHandler = EventHandler<DragEvent>;
|
||||
type FocusEventHandler = EventHandler<FocusEvent>;
|
||||
type KeyboardEventHandler = EventHandler<KeyboardEvent>;
|
||||
type MouseEventHandler = EventHandler<MouseEvent>;
|
||||
type TouchEventHandler = EventHandler<TouchEvent>;
|
||||
type UIEventHandler = EventHandler<UIEvent>;
|
||||
type WheelEventHandler = EventHandler<WheelEvent>;
|
||||
type AnimationEventHandler = EventHandler<AnimationEvent>;
|
||||
type TransitionEventHandler = EventHandler<TransitionEvent>;
|
||||
type GenericEventHandler = EventHandler<Event>;
|
||||
type PointerEventHandler = EventHandler<PointerEvent>;
|
||||
|
||||
interface DOMAttributes extends Omi.OmiDOMAttributes {
|
||||
// Image Events
|
||||
onLoad?: GenericEventHandler;
|
||||
onError?: GenericEventHandler;
|
||||
onLoadCapture?: GenericEventHandler;
|
||||
|
||||
// Clipboard Events
|
||||
onCopy?: ClipboardEventHandler;
|
||||
onCopyCapture?: ClipboardEventHandler;
|
||||
onCut?: ClipboardEventHandler;
|
||||
onCutCapture?: ClipboardEventHandler;
|
||||
onPaste?: ClipboardEventHandler;
|
||||
onPasteCapture?: ClipboardEventHandler;
|
||||
|
||||
// Composition Events
|
||||
onCompositionEnd?: CompositionEventHandler;
|
||||
onCompositionEndCapture?: CompositionEventHandler;
|
||||
onCompositionStart?: CompositionEventHandler;
|
||||
onCompositionStartCapture?: CompositionEventHandler;
|
||||
onCompositionUpdate?: CompositionEventHandler;
|
||||
onCompositionUpdateCapture?: CompositionEventHandler;
|
||||
|
||||
// Focus Events
|
||||
onFocus?: FocusEventHandler;
|
||||
onFocusCapture?: FocusEventHandler;
|
||||
onBlur?: FocusEventHandler;
|
||||
onBlurCapture?: FocusEventHandler;
|
||||
|
||||
// Form Events
|
||||
onChange?: GenericEventHandler;
|
||||
onChangeCapture?: GenericEventHandler;
|
||||
onInput?: GenericEventHandler;
|
||||
onInputCapture?: GenericEventHandler;
|
||||
onSearch?: GenericEventHandler;
|
||||
onSearchCapture?: GenericEventHandler;
|
||||
onSubmit?: GenericEventHandler;
|
||||
onSubmitCapture?: GenericEventHandler;
|
||||
|
||||
// Keyboard Events
|
||||
onKeyDown?: KeyboardEventHandler;
|
||||
onKeyDownCapture?: KeyboardEventHandler;
|
||||
onKeyPress?: KeyboardEventHandler;
|
||||
onKeyPressCapture?: KeyboardEventHandler;
|
||||
onKeyUp?: KeyboardEventHandler;
|
||||
onKeyUpCapture?: KeyboardEventHandler;
|
||||
|
||||
// Media Events
|
||||
onAbort?: GenericEventHandler;
|
||||
onAbortCapture?: GenericEventHandler;
|
||||
onCanPlay?: GenericEventHandler;
|
||||
onCanPlayCapture?: GenericEventHandler;
|
||||
onCanPlayThrough?: GenericEventHandler;
|
||||
onCanPlayThroughCapture?: GenericEventHandler;
|
||||
onDurationChange?: GenericEventHandler;
|
||||
onDurationChangeCapture?: GenericEventHandler;
|
||||
onEmptied?: GenericEventHandler;
|
||||
onEmptiedCapture?: GenericEventHandler;
|
||||
onEncrypted?: GenericEventHandler;
|
||||
onEncryptedCapture?: GenericEventHandler;
|
||||
onEnded?: GenericEventHandler;
|
||||
onEndedCapture?: GenericEventHandler;
|
||||
onLoadedData?: GenericEventHandler;
|
||||
onLoadedDataCapture?: GenericEventHandler;
|
||||
onLoadedMetadata?: GenericEventHandler;
|
||||
onLoadedMetadataCapture?: GenericEventHandler;
|
||||
onLoadStart?: GenericEventHandler;
|
||||
onLoadStartCapture?: GenericEventHandler;
|
||||
onPause?: GenericEventHandler;
|
||||
onPauseCapture?: GenericEventHandler;
|
||||
onPlay?: GenericEventHandler;
|
||||
onPlayCapture?: GenericEventHandler;
|
||||
onPlaying?: GenericEventHandler;
|
||||
onPlayingCapture?: GenericEventHandler;
|
||||
onProgress?: GenericEventHandler;
|
||||
onProgressCapture?: GenericEventHandler;
|
||||
onRateChange?: GenericEventHandler;
|
||||
onRateChangeCapture?: GenericEventHandler;
|
||||
onSeeked?: GenericEventHandler;
|
||||
onSeekedCapture?: GenericEventHandler;
|
||||
onSeeking?: GenericEventHandler;
|
||||
onSeekingCapture?: GenericEventHandler;
|
||||
onStalled?: GenericEventHandler;
|
||||
onStalledCapture?: GenericEventHandler;
|
||||
onSuspend?: GenericEventHandler;
|
||||
onSuspendCapture?: GenericEventHandler;
|
||||
onTimeUpdate?: GenericEventHandler;
|
||||
onTimeUpdateCapture?: GenericEventHandler;
|
||||
onVolumeChange?: GenericEventHandler;
|
||||
onVolumeChangeCapture?: GenericEventHandler;
|
||||
onWaiting?: GenericEventHandler;
|
||||
onWaitingCapture?: GenericEventHandler;
|
||||
|
||||
// MouseEvents
|
||||
onClick?: MouseEventHandler;
|
||||
onClickCapture?: MouseEventHandler;
|
||||
onContextMenu?: MouseEventHandler;
|
||||
onContextMenuCapture?: MouseEventHandler;
|
||||
onDblClick?: MouseEventHandler;
|
||||
onDblClickCapture?: MouseEventHandler;
|
||||
onDrag?: DragEventHandler;
|
||||
onDragCapture?: DragEventHandler;
|
||||
onDragEnd?: DragEventHandler;
|
||||
onDragEndCapture?: DragEventHandler;
|
||||
onDragEnter?: DragEventHandler;
|
||||
onDragEnterCapture?: DragEventHandler;
|
||||
onDragExit?: DragEventHandler;
|
||||
onDragExitCapture?: DragEventHandler;
|
||||
onDragLeave?: DragEventHandler;
|
||||
onDragLeaveCapture?: DragEventHandler;
|
||||
onDragOver?: DragEventHandler;
|
||||
onDragOverCapture?: DragEventHandler;
|
||||
onDragStart?: DragEventHandler;
|
||||
onDragStartCapture?: DragEventHandler;
|
||||
onDrop?: DragEventHandler;
|
||||
onDropCapture?: DragEventHandler;
|
||||
onMouseDown?: MouseEventHandler;
|
||||
onMouseDownCapture?: MouseEventHandler;
|
||||
onMouseEnter?: MouseEventHandler;
|
||||
onMouseEnterCapture?: MouseEventHandler;
|
||||
onMouseLeave?: MouseEventHandler;
|
||||
onMouseLeaveCapture?: MouseEventHandler;
|
||||
onMouseMove?: MouseEventHandler;
|
||||
onMouseMoveCapture?: MouseEventHandler;
|
||||
onMouseOut?: MouseEventHandler;
|
||||
onMouseOutCapture?: MouseEventHandler;
|
||||
onMouseOver?: MouseEventHandler;
|
||||
onMouseOverCapture?: MouseEventHandler;
|
||||
onMouseUp?: MouseEventHandler;
|
||||
onMouseUpCapture?: MouseEventHandler;
|
||||
|
||||
// Selection Events
|
||||
onSelect?: GenericEventHandler;
|
||||
onSelectCapture?: GenericEventHandler;
|
||||
|
||||
// Touch Events
|
||||
onTouchCancel?: TouchEventHandler;
|
||||
onTouchCancelCapture?: TouchEventHandler;
|
||||
onTouchEnd?: TouchEventHandler;
|
||||
onTouchEndCapture?: TouchEventHandler;
|
||||
onTouchMove?: TouchEventHandler;
|
||||
onTouchMoveCapture?: TouchEventHandler;
|
||||
onTouchStart?: TouchEventHandler;
|
||||
onTouchStartCapture?: TouchEventHandler;
|
||||
|
||||
// Pointer Events
|
||||
onPointerOver?: PointerEventHandler;
|
||||
onPointerOverCapture?: PointerEventHandler;
|
||||
onPointerEnter?: PointerEventHandler;
|
||||
onPointerEnterCapture?: PointerEventHandler;
|
||||
onPointerDown?: PointerEventHandler;
|
||||
onPointerDownCapture?: PointerEventHandler;
|
||||
onPointerMove?: PointerEventHandler;
|
||||
onPointerMoveCapture?: PointerEventHandler;
|
||||
onPointerUp?: PointerEventHandler;
|
||||
onPointerUpCapture?: PointerEventHandler;
|
||||
onPointerCancel?: PointerEventHandler;
|
||||
onPointerCancelCapture?: PointerEventHandler;
|
||||
onPointerOut?: PointerEventHandler;
|
||||
onPointerOutCapture?: PointerEventHandler;
|
||||
onPointerLeave?: PointerEventHandler;
|
||||
onPointerLeaveCapture?: PointerEventHandler;
|
||||
onGotPointerCapture?: PointerEventHandler;
|
||||
onGotPointerCaptureCapture?: PointerEventHandler;
|
||||
onLostPointerCapture?: PointerEventHandler;
|
||||
onLostPointerCaptureCapture?: PointerEventHandler;
|
||||
|
||||
// UI Events
|
||||
onScroll?: UIEventHandler;
|
||||
onScrollCapture?: UIEventHandler;
|
||||
|
||||
// Wheel Events
|
||||
onWheel?: WheelEventHandler;
|
||||
onWheelCapture?: WheelEventHandler;
|
||||
|
||||
// Animation Events
|
||||
onAnimationStart?: AnimationEventHandler;
|
||||
onAnimationStartCapture?: AnimationEventHandler;
|
||||
onAnimationEnd?: AnimationEventHandler;
|
||||
onAnimationEndCapture?: AnimationEventHandler;
|
||||
onAnimationIteration?: AnimationEventHandler;
|
||||
onAnimationIterationCapture?: AnimationEventHandler;
|
||||
|
||||
// Transition Events
|
||||
onTransitionEnd?: TransitionEventHandler;
|
||||
onTransitionEndCapture?: TransitionEventHandler;
|
||||
}
|
||||
|
||||
interface HTMLAttributes extends Omi.ClassAttributes<any>, DOMAttributes {
|
||||
// Standard HTML Attributes
|
||||
accept?: string;
|
||||
acceptCharset?: string;
|
||||
accessKey?: string;
|
||||
action?: string;
|
||||
allowFullScreen?: boolean;
|
||||
allowTransparency?: boolean;
|
||||
alt?: string;
|
||||
async?: boolean;
|
||||
autocomplete?: string;
|
||||
autofocus?: boolean;
|
||||
autoPlay?: boolean;
|
||||
capture?: boolean;
|
||||
cellPadding?: number | string;
|
||||
cellSpacing?: number | string;
|
||||
charSet?: string;
|
||||
challenge?: string;
|
||||
checked?: boolean;
|
||||
class?: string;
|
||||
className?: string;
|
||||
cols?: number;
|
||||
colSpan?: number;
|
||||
content?: string;
|
||||
contentEditable?: boolean;
|
||||
contextMenu?: string;
|
||||
controls?: boolean;
|
||||
controlsList?: string;
|
||||
coords?: string;
|
||||
crossOrigin?: string;
|
||||
data?: string;
|
||||
dateTime?: string;
|
||||
default?: boolean;
|
||||
defer?: boolean;
|
||||
dir?: string;
|
||||
disabled?: boolean;
|
||||
download?: any;
|
||||
draggable?: boolean;
|
||||
encType?: string;
|
||||
form?: string;
|
||||
formAction?: string;
|
||||
formEncType?: string;
|
||||
formMethod?: string;
|
||||
formNoValidate?: boolean;
|
||||
formTarget?: string;
|
||||
frameBorder?: number | string;
|
||||
headers?: string;
|
||||
height?: number | string;
|
||||
hidden?: boolean;
|
||||
high?: number;
|
||||
href?: string;
|
||||
hrefLang?: string;
|
||||
for?: string;
|
||||
httpEquiv?: string;
|
||||
icon?: string;
|
||||
id?: string;
|
||||
inputMode?: string;
|
||||
integrity?: string;
|
||||
is?: string;
|
||||
keyParams?: string;
|
||||
keyType?: string;
|
||||
kind?: string;
|
||||
label?: string;
|
||||
lang?: string;
|
||||
list?: string;
|
||||
loop?: boolean;
|
||||
low?: number;
|
||||
manifest?: string;
|
||||
marginHeight?: number;
|
||||
marginWidth?: number;
|
||||
max?: number | string;
|
||||
maxLength?: number;
|
||||
media?: string;
|
||||
mediaGroup?: string;
|
||||
method?: string;
|
||||
min?: number | string;
|
||||
minLength?: number;
|
||||
multiple?: boolean;
|
||||
muted?: boolean;
|
||||
name?: string;
|
||||
noValidate?: boolean;
|
||||
open?: boolean;
|
||||
optimum?: number;
|
||||
pattern?: string;
|
||||
placeholder?: string;
|
||||
playsInline?: boolean;
|
||||
poster?: string;
|
||||
preload?: string;
|
||||
radioGroup?: string;
|
||||
readOnly?: boolean;
|
||||
rel?: string;
|
||||
required?: boolean;
|
||||
role?: string;
|
||||
rows?: number;
|
||||
rowSpan?: number;
|
||||
sandbox?: string;
|
||||
scope?: string;
|
||||
scoped?: boolean;
|
||||
scrolling?: string;
|
||||
seamless?: boolean;
|
||||
selected?: boolean;
|
||||
shape?: string;
|
||||
size?: number;
|
||||
sizes?: string;
|
||||
slot?: string;
|
||||
span?: number;
|
||||
spellcheck?: boolean;
|
||||
src?: string;
|
||||
srcset?: string;
|
||||
srcDoc?: string;
|
||||
srcLang?: string;
|
||||
srcSet?: string;
|
||||
start?: number;
|
||||
step?: number | string;
|
||||
style?: any;
|
||||
summary?: string;
|
||||
tabIndex?: number;
|
||||
target?: string;
|
||||
title?: string;
|
||||
type?: string;
|
||||
useMap?: string;
|
||||
value?: string | string[] | number;
|
||||
width?: number | string;
|
||||
wmode?: string;
|
||||
wrap?: string;
|
||||
|
||||
// RDFa Attributes
|
||||
about?: string;
|
||||
datatype?: string;
|
||||
inlist?: any;
|
||||
prefix?: string;
|
||||
property?: string;
|
||||
resource?: string;
|
||||
typeof?: string;
|
||||
vocab?: string;
|
||||
}
|
||||
|
||||
interface IntrinsicElements {
|
||||
// HTML
|
||||
a: HTMLAttributes;
|
||||
abbr: HTMLAttributes;
|
||||
address: HTMLAttributes;
|
||||
area: HTMLAttributes;
|
||||
article: HTMLAttributes;
|
||||
aside: HTMLAttributes;
|
||||
audio: HTMLAttributes;
|
||||
b: HTMLAttributes;
|
||||
base: HTMLAttributes;
|
||||
bdi: HTMLAttributes;
|
||||
bdo: HTMLAttributes;
|
||||
big: HTMLAttributes;
|
||||
blockquote: HTMLAttributes;
|
||||
body: HTMLAttributes;
|
||||
br: HTMLAttributes;
|
||||
button: HTMLAttributes;
|
||||
canvas: HTMLAttributes;
|
||||
caption: HTMLAttributes;
|
||||
cite: HTMLAttributes;
|
||||
code: HTMLAttributes;
|
||||
col: HTMLAttributes;
|
||||
colgroup: HTMLAttributes;
|
||||
data: HTMLAttributes;
|
||||
datalist: HTMLAttributes;
|
||||
dd: HTMLAttributes;
|
||||
del: HTMLAttributes;
|
||||
details: HTMLAttributes;
|
||||
dfn: HTMLAttributes;
|
||||
dialog: HTMLAttributes;
|
||||
div: HTMLAttributes;
|
||||
dl: HTMLAttributes;
|
||||
dt: HTMLAttributes;
|
||||
em: HTMLAttributes;
|
||||
embed: HTMLAttributes;
|
||||
fieldset: HTMLAttributes;
|
||||
figcaption: HTMLAttributes;
|
||||
figure: HTMLAttributes;
|
||||
footer: HTMLAttributes;
|
||||
form: HTMLAttributes;
|
||||
h1: HTMLAttributes;
|
||||
h2: HTMLAttributes;
|
||||
h3: HTMLAttributes;
|
||||
h4: HTMLAttributes;
|
||||
h5: HTMLAttributes;
|
||||
h6: HTMLAttributes;
|
||||
head: HTMLAttributes;
|
||||
header: HTMLAttributes;
|
||||
hr: HTMLAttributes;
|
||||
html: HTMLAttributes;
|
||||
i: HTMLAttributes;
|
||||
iframe: HTMLAttributes;
|
||||
img: HTMLAttributes;
|
||||
input: HTMLAttributes;
|
||||
ins: HTMLAttributes;
|
||||
kbd: HTMLAttributes;
|
||||
keygen: HTMLAttributes;
|
||||
label: HTMLAttributes;
|
||||
legend: HTMLAttributes;
|
||||
li: HTMLAttributes;
|
||||
link: HTMLAttributes;
|
||||
main: HTMLAttributes;
|
||||
map: HTMLAttributes;
|
||||
mark: HTMLAttributes;
|
||||
menu: HTMLAttributes;
|
||||
menuitem: HTMLAttributes;
|
||||
meta: HTMLAttributes;
|
||||
meter: HTMLAttributes;
|
||||
nav: HTMLAttributes;
|
||||
noscript: HTMLAttributes;
|
||||
object: HTMLAttributes;
|
||||
ol: HTMLAttributes;
|
||||
optgroup: HTMLAttributes;
|
||||
option: HTMLAttributes;
|
||||
output: HTMLAttributes;
|
||||
p: HTMLAttributes;
|
||||
param: HTMLAttributes;
|
||||
picture: HTMLAttributes;
|
||||
pre: HTMLAttributes;
|
||||
progress: HTMLAttributes;
|
||||
q: HTMLAttributes;
|
||||
rp: HTMLAttributes;
|
||||
rt: HTMLAttributes;
|
||||
ruby: HTMLAttributes;
|
||||
s: HTMLAttributes;
|
||||
samp: HTMLAttributes;
|
||||
script: HTMLAttributes;
|
||||
section: HTMLAttributes;
|
||||
select: HTMLAttributes;
|
||||
slot: HTMLAttributes;
|
||||
small: HTMLAttributes;
|
||||
source: HTMLAttributes;
|
||||
span: HTMLAttributes;
|
||||
strong: HTMLAttributes;
|
||||
style: HTMLAttributes;
|
||||
sub: HTMLAttributes;
|
||||
summary: HTMLAttributes;
|
||||
sup: HTMLAttributes;
|
||||
table: HTMLAttributes;
|
||||
tbody: HTMLAttributes;
|
||||
td: HTMLAttributes;
|
||||
textarea: HTMLAttributes;
|
||||
tfoot: HTMLAttributes;
|
||||
th: HTMLAttributes;
|
||||
thead: HTMLAttributes;
|
||||
time: HTMLAttributes;
|
||||
title: HTMLAttributes;
|
||||
tr: HTMLAttributes;
|
||||
track: HTMLAttributes;
|
||||
u: HTMLAttributes;
|
||||
ul: HTMLAttributes;
|
||||
"var": HTMLAttributes;
|
||||
video: HTMLAttributes;
|
||||
wbr: HTMLAttributes;
|
||||
|
||||
//SVG
|
||||
svg: SVGAttributes;
|
||||
animate: SVGAttributes;
|
||||
circle: SVGAttributes;
|
||||
clipPath: SVGAttributes;
|
||||
defs: SVGAttributes;
|
||||
ellipse: SVGAttributes;
|
||||
feBlend: SVGAttributes;
|
||||
feColorMatrix: SVGAttributes;
|
||||
feComponentTransfer: SVGAttributes;
|
||||
feComposite: SVGAttributes;
|
||||
feConvolveMatrix: SVGAttributes;
|
||||
feDiffuseLighting: SVGAttributes;
|
||||
feDisplacementMap: SVGAttributes;
|
||||
feFlood: SVGAttributes;
|
||||
feGaussianBlur: SVGAttributes;
|
||||
feImage: SVGAttributes;
|
||||
feMerge: SVGAttributes;
|
||||
feMergeNode: SVGAttributes;
|
||||
feMorphology: SVGAttributes;
|
||||
feOffset: SVGAttributes;
|
||||
feSpecularLighting: SVGAttributes;
|
||||
feTile: SVGAttributes;
|
||||
feTurbulence: SVGAttributes;
|
||||
filter: SVGAttributes;
|
||||
foreignObject: SVGAttributes;
|
||||
g: SVGAttributes;
|
||||
image: SVGAttributes;
|
||||
line: SVGAttributes;
|
||||
linearGradient: SVGAttributes;
|
||||
marker: SVGAttributes;
|
||||
mask: SVGAttributes;
|
||||
path: SVGAttributes;
|
||||
pattern: SVGAttributes;
|
||||
polygon: SVGAttributes;
|
||||
polyline: SVGAttributes;
|
||||
radialGradient: SVGAttributes;
|
||||
rect: SVGAttributes;
|
||||
stop: SVGAttributes;
|
||||
symbol: SVGAttributes;
|
||||
text: SVGAttributes;
|
||||
tspan: SVGAttributes;
|
||||
use: SVGAttributes;
|
||||
[tagName: string]: any;
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,13 @@
|
|||
/* @flow */
|
||||
|
||||
import { createElement, cloneElement, Component, type Node } from 'react';
|
||||
|
||||
declare var h: createElement;
|
||||
|
||||
declare function render(vnode: Node, parent: Element, toReplace?: Element): Element;
|
||||
|
||||
export { h, createElement, cloneElement, Component, render };
|
||||
export default { h, createElement, cloneElement, Component, render };
|
||||
|
||||
declare export function rerender(): void;
|
||||
declare export var options: Object;
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,146 @@
|
|||
import { WeElement, define, render } from 'omi'
|
||||
import 'omi-router'
|
||||
|
||||
let currentPage = null
|
||||
let stackList = []
|
||||
|
||||
window.stackList = stackList
|
||||
define('o-router', class extends WeElement {
|
||||
|
||||
_firstTime = true
|
||||
|
||||
installed() {
|
||||
const root = document.querySelector('#app')
|
||||
let main
|
||||
this.props.routes.forEach(current => {
|
||||
route(current.path, (evt) => {
|
||||
current.componentLoader()
|
||||
.then(res => {
|
||||
const arr = current.path.replace(/pages/, 'page').split('/')
|
||||
const selector = current.path.replace(/\//g, '-')
|
||||
routeUpdate({ nodeName: arr[1] + '-' + arr[2], attributes: { className: selector } }, selector, evt.byNative, root)
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
})
|
||||
})
|
||||
if (current.isIndex) {
|
||||
main = current
|
||||
current.componentLoader()
|
||||
.then(res => {
|
||||
const arr = this.props.routes[0].path.replace(/pages/, 'page').split('/')
|
||||
const selector = main.path.replace(/\//g, '-')
|
||||
|
||||
this.vd = { nodeName: arr[1] + '-' + arr[2] }
|
||||
this.update()
|
||||
const ele = root.childNodes[root.childNodes.length - 1]
|
||||
stackList.push({ slt: selector, ele: ele, display: window.getComputedStyle(ele).display, scrollTop: 0 })
|
||||
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
route('*', (evt) => {
|
||||
main.componentLoader()
|
||||
.then(res => {
|
||||
const arr = main.path.replace(/pages/, 'page').split('/')
|
||||
const selector = main.path.replace(/\//g, '-')
|
||||
routeUpdate({ nodeName: arr[1] + '-' + arr[2] }, selector, evt.byNative, root)
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
if (this._firstTime) {
|
||||
this._firstTime = false
|
||||
return null
|
||||
} else {
|
||||
return this.vd
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
export function routeUpdate(vnode, selector, byNative, root) {
|
||||
root.childNodes.forEach(child => {
|
||||
if (child.style.display !== 'none') {
|
||||
child.style.display = 'none'
|
||||
child.onHide && child.onHide()
|
||||
child._component && child._component.onHide && child._component.onHide()
|
||||
}
|
||||
})
|
||||
const item = getElement(selector)
|
||||
if (byNative) {
|
||||
//浏览器后退
|
||||
if (item && item.ele) {
|
||||
const ele = item.ele
|
||||
ele.style.display = item.display
|
||||
ele.onShow && ele.onShow()
|
||||
ele._component && ele._component.onShow && ele._component.onShow()
|
||||
currentPage = ele
|
||||
document.documentElement.scrollTop = item.scrollTop
|
||||
document.body.scrollTop = item.scrollTop
|
||||
//set twice
|
||||
setTimeout(function () {
|
||||
document.documentElement.scrollTop = item.scrollTop
|
||||
document.body.scrollTop = item.scrollTop
|
||||
}, 0)
|
||||
} else {
|
||||
const node = render(vnode, root)
|
||||
node.onShow && node.onShow()
|
||||
node._component && node._component.onShow && node._component.onShow()
|
||||
currentPage = node
|
||||
document.documentElement.scrollTop = 0
|
||||
document.body.scrollTop = 0
|
||||
}
|
||||
} else {
|
||||
//前进
|
||||
if (item && item.ele) {
|
||||
item.ele.parentNode.removeChild(item.ele)
|
||||
remove(item)
|
||||
}
|
||||
const node = render(vnode, root)
|
||||
node.onShow && node.onShow()
|
||||
node._component && node._component.onShow && node._component.onShow()
|
||||
currentPage = node
|
||||
|
||||
const ele = root.childNodes[root.childNodes.length - 1]
|
||||
stackList.push({ slt: selector, ele: ele, display: window.getComputedStyle(ele).display, scrollTop: 0 })
|
||||
document.documentElement.scrollTop = 0
|
||||
document.body.scrollTop = 0
|
||||
}
|
||||
}
|
||||
|
||||
function getElement(slt) {
|
||||
for (let i = 0, length = stackList.length; i < length; i++) {
|
||||
if (stackList[i].slt === slt) {
|
||||
return stackList[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function remove(item) {
|
||||
for (let i = 0, length = stackList.length; i < length; i++) {
|
||||
if (stackList[i] === item) {
|
||||
stackList.splice(i, 1)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
window.onscroll = function () {
|
||||
const top = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
|
||||
for (let i = 0, length = stackList.length; i < length; i++) {
|
||||
if (stackList[i].ele === currentPage) {
|
||||
stackList[i].scrollTop = top
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
|
@ -50,7 +50,7 @@ define('page-list', class extends WeElement {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { showLoading, films } = this.data
|
||||
const { showLoading, films, hasMore } = this.data
|
||||
|
||||
if (showLoading) {
|
||||
return (
|
||||
|
|
|
@ -0,0 +1,107 @@
|
|||
const config = {
|
||||
projectName: 'my-app',
|
||||
date: '2019-2-21',
|
||||
designWidth: 750,
|
||||
deviceRatio: {
|
||||
'640': 2.34 / 2,
|
||||
'750': 1,
|
||||
'828': 1.81 / 2
|
||||
},
|
||||
alias: {
|
||||
'omi': 'src/libs/omip-h5/omi.esm.js',
|
||||
'@tarojs': 'src/libs'
|
||||
},
|
||||
sourceRoot: 'src',
|
||||
outputRoot: 'dist',
|
||||
plugins: {
|
||||
babel: {
|
||||
sourceMap: true,
|
||||
presets: [
|
||||
['env', {
|
||||
modules: false
|
||||
}]
|
||||
],
|
||||
plugins: [
|
||||
'transform-decorators-legacy',
|
||||
'transform-class-properties',
|
||||
'transform-object-rest-spread',
|
||||
// ['transform-react-jsx', { pragma: 'global.Omi.h' }]
|
||||
]
|
||||
}
|
||||
},
|
||||
defineConstants: {
|
||||
},
|
||||
copy: {
|
||||
patterns: [
|
||||
],
|
||||
options: {
|
||||
}
|
||||
},
|
||||
weapp: {
|
||||
module: {
|
||||
postcss: {
|
||||
autoprefixer: {
|
||||
enable: true,
|
||||
config: {
|
||||
browsers: [
|
||||
'last 3 versions',
|
||||
'Android >= 4.1',
|
||||
'ios >= 8'
|
||||
]
|
||||
}
|
||||
},
|
||||
pxtransform: {
|
||||
enable: false,
|
||||
config: {
|
||||
|
||||
}
|
||||
},
|
||||
url: {
|
||||
enable: true,
|
||||
config: {
|
||||
limit: 10240 // 设定转换尺寸上限
|
||||
}
|
||||
},
|
||||
cssModules: {
|
||||
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
||||
config: {
|
||||
namingPattern: 'module', // 转换模式,取值为 global/module
|
||||
generateScopedName: '[name]__[local]___[hash:base64:5]'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
h5: {
|
||||
publicPath: '/',
|
||||
staticDirectory: 'static',
|
||||
module: {
|
||||
postcss: {
|
||||
autoprefixer: {
|
||||
enable: true,
|
||||
config: {
|
||||
browsers: [
|
||||
'last 3 versions',
|
||||
'Android >= 4.1',
|
||||
'ios >= 8'
|
||||
]
|
||||
}
|
||||
},
|
||||
cssModules: {
|
||||
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
||||
config: {
|
||||
namingPattern: 'module', // 转换模式,取值为 global/module
|
||||
generateScopedName: '[name]__[local]___[hash:base64:5]'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function (merge) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
return merge({}, config, require('./dev'))
|
||||
}
|
||||
return merge({}, config, require('./prod'))
|
||||
}
|
|
@ -5,5 +5,7 @@ module.exports = {
|
|||
defineConstants: {
|
||||
},
|
||||
weapp: {},
|
||||
h5: {}
|
||||
h5: {
|
||||
publicPath: './',
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.0.0-beta.44",
|
||||
"@fdaciuk/ajax": "^3.0.4",
|
||||
"@tarojs/components": "1.2.13",
|
||||
"@tarojs/router": "1.2.13",
|
||||
"@tarojs/taro": "1.2.13",
|
||||
|
@ -28,16 +30,23 @@
|
|||
"@tarojs/taro-swan": "1.2.13",
|
||||
"@tarojs/taro-tt": "1.2.13",
|
||||
"@tarojs/taro-weapp": "1.2.13",
|
||||
"nerv-devtools": "^1.3.9",
|
||||
"nervjs": "^1.3.9",
|
||||
"@tarojs/taroize": "1.2.13",
|
||||
"autoprefixer": "^8.4.1",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-eslint": "^8.2.3",
|
||||
"babel-generator": "^6.26.1",
|
||||
"babel-helper-evaluate-path": "^0.5.0",
|
||||
"babel-helper-mark-eval-scopes": "^0.4.3",
|
||||
"babel-helper-remove-or-void": "^0.4.3",
|
||||
"babel-plugin-danger-remove-unused-import": "^1.1.1",
|
||||
"babel-plugin-minify-dead-code": "^0.5.2",
|
||||
"babel-plugin-remove-dead-code": "^1.3.2",
|
||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
||||
"babel-plugin-transform-define": "^1.3.0",
|
||||
"babel-plugin-transform-es2015-template-literals": "^6.22.0",
|
||||
"babel-plugin-transform-flow-strip-types": "^6.22.0",
|
||||
"babel-plugin-transform-jsx-to-stylesheet": "1.2.13",
|
||||
"babel-plugin-transform-react-jsx": "^6.24.1",
|
||||
"babel-template": "^6.26.0",
|
||||
|
@ -52,9 +61,12 @@
|
|||
"css-to-react-native-transform": "^1.4.0",
|
||||
"ejs": "^2.6.1",
|
||||
"envinfo": "^6.0.1",
|
||||
"eslint": "^4.15.0",
|
||||
"eslint-plugin-taro": "1.2.13",
|
||||
"fs-extra": "^5.0.0",
|
||||
"generic-names": "^2.0.1",
|
||||
"glob": "^7.1.2",
|
||||
"html": "^1.0.0",
|
||||
"inquirer": "^5.2.0",
|
||||
"klaw": "^2.1.1",
|
||||
"latest-version": "^4.0.0",
|
||||
|
@ -62,6 +74,9 @@
|
|||
"mem-fs": "^1.1.3",
|
||||
"mem-fs-editor": "^4.0.0",
|
||||
"minimatch": "^3.0.4",
|
||||
"nerv-devtools": "^1.3.9",
|
||||
"nervjs": "^1.3.9",
|
||||
"omi-router": "^2.0.8",
|
||||
"ora": "^2.0.0",
|
||||
"postcss": "^6.0.22",
|
||||
"postcss-modules-extract-imports": "^1.1.0",
|
||||
|
@ -78,22 +93,9 @@
|
|||
"semver": "^5.5.0",
|
||||
"shelljs": "^0.8.1",
|
||||
"through2": "^2.0.3",
|
||||
"typescript": "^3.2.2",
|
||||
"vinyl": "^2.1.0",
|
||||
"vinyl-fs": "^3.0.2",
|
||||
"@babel/code-frame": "^7.0.0-beta.44",
|
||||
"babel-eslint": "^8.2.3",
|
||||
"babel-helper-evaluate-path": "^0.5.0",
|
||||
"babel-helper-mark-eval-scopes": "^0.4.3",
|
||||
"babel-helper-remove-or-void": "^0.4.3",
|
||||
"babel-plugin-minify-dead-code": "^0.5.2",
|
||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-es2015-template-literals": "^6.22.0",
|
||||
"babel-plugin-transform-flow-strip-types": "^6.22.0",
|
||||
"eslint": "^4.15.0",
|
||||
"eslint-plugin-taro": "1.2.13",
|
||||
"html": "^1.0.0",
|
||||
"typescript": "^3.2.2"
|
||||
"vinyl-fs": "^3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^16.4.6",
|
||||
|
|
|
@ -18,7 +18,9 @@ const CONFIG = require('./config')
|
|||
const { source: toAst, getObjKey } = require('./util/ast_convert')
|
||||
|
||||
const appPath = process.cwd()
|
||||
const projectConfig = require(path.join(appPath, Util.PROJECT_CONFIG))(_.merge)
|
||||
//@fix
|
||||
const projectConfig = require(path.join(appPath, Util.PROJECT_CONFIG_H5))(_.merge)
|
||||
|
||||
const h5Config = projectConfig.h5 || {}
|
||||
const routerConfig = h5Config.router || {}
|
||||
const routerMode = routerConfig.mode === 'browser' ? 'browser' : 'hash'
|
||||
|
@ -69,10 +71,21 @@ const DEVICE_RATIO = 'deviceRatio'
|
|||
if (projectConfig.hasOwnProperty(DEVICE_RATIO)) {
|
||||
pxTransformConfig[DEVICE_RATIO] = projectConfig.deviceRatio
|
||||
}
|
||||
//@fix
|
||||
if (!String.prototype.endsWith) {
|
||||
String.prototype.endsWith = function(search, this_len) {
|
||||
if (this_len === undefined || this_len > this.length) {
|
||||
this_len = this.length;
|
||||
}
|
||||
return this.substring(this_len - search.length, this_len) === search;
|
||||
};
|
||||
}
|
||||
|
||||
let pages = []
|
||||
let tabBar
|
||||
let tabbarPos
|
||||
//@fix
|
||||
let appCSS = ''
|
||||
|
||||
const FILE_TYPE = {
|
||||
ENTRY: 'ENTRY',
|
||||
|
@ -199,8 +212,8 @@ function processEntry (code, filePath) {
|
|||
isIndex: k === 0
|
||||
})
|
||||
})
|
||||
|
||||
funcBody = `<Router
|
||||
//@fix
|
||||
funcBody = `<o-router
|
||||
mode={${JSON.stringify(routerMode)}}
|
||||
publicPath={${JSON.stringify(routerMode === 'hash' ? '/' : publicPath)}}
|
||||
routes={[${routes.join(',')}]}
|
||||
|
@ -295,11 +308,12 @@ function processEntry (code, filePath) {
|
|||
'method', t.identifier('componentWillUnmount'), [],
|
||||
t.blockStatement([]), false, false))
|
||||
}
|
||||
if (!hasConstructor) {
|
||||
astPath.pushContainer('body', t.classMethod(
|
||||
'method', t.identifier('constructor'), [t.identifier('props'), t.identifier('context')],
|
||||
t.blockStatement([toAst('super(props, context)'), additionalConstructorNode]), false, false))
|
||||
}
|
||||
//@fix
|
||||
// if (!hasConstructor) {
|
||||
// astPath.pushContainer('body', t.classMethod(
|
||||
// 'method', t.identifier('constructor'), [t.identifier('props'), t.identifier('context')],
|
||||
// t.blockStatement([toAst('super(props, context)'), additionalConstructorNode]), false, false))
|
||||
// }
|
||||
if (tabBar) {
|
||||
if (!hasComponentWillMount) {
|
||||
astPath.pushContainer('body', t.classMethod(
|
||||
|
@ -376,6 +390,13 @@ function processEntry (code, filePath) {
|
|||
const source = node.source
|
||||
const specifiers = node.specifiers
|
||||
let value = source.value
|
||||
//@fix
|
||||
if(value.endsWith('.css')){
|
||||
appCSS = fs.readFileSync(filePath.replace('.js','.css'), 'utf-8').replace(/\/\*[^*]*\*+([^/][^*]*\*+)*\//g, '')
|
||||
// astPath.replaceWith(t.variableDeclaration('const',[t.variableDeclarator(t.identifier(`___css`),t.stringLiteral(appCSS))]))
|
||||
astPath.remove()
|
||||
return
|
||||
}
|
||||
if (Util.isAliasPath(value, pathAlias)) {
|
||||
source.value = value = Util.replaceAliasPath(filePath, value, pathAlias)
|
||||
}
|
||||
|
@ -402,9 +423,10 @@ function processEntry (code, filePath) {
|
|||
specifier.local.name = nervJsImportDefaultName
|
||||
} else if (!hasAddNervJsImportDefaultName) {
|
||||
hasAddNervJsImportDefaultName = true
|
||||
node.specifiers.unshift(
|
||||
t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
)
|
||||
//@fix
|
||||
// node.specifiers.unshift(
|
||||
// t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
// )
|
||||
}
|
||||
const taroApisSpecifiers = []
|
||||
const deletedIdx = []
|
||||
|
@ -512,20 +534,26 @@ function processEntry (code, filePath) {
|
|||
exit (astPath) {
|
||||
const importNervjsNode = t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
const importRouterNode = toAst(`import { Router } from '${PACKAGES['@tarojs/router']}'`)
|
||||
//@fix
|
||||
const importMpNode = toAst(`import './libs/mp'`)
|
||||
const importTaroH5Node = toAst(`import ${taroImportDefaultName} from '${PACKAGES['@tarojs/taro-h5']}'`)
|
||||
const importComponentNode = toAst(`import { View, ${tabBarComponentName}, ${tabBarContainerComponentName}, ${tabBarPanelComponentName}} from '${PACKAGES['@tarojs/components']}'`)
|
||||
const lastImportIndex = _.findLastIndex(astPath.node.body, t.isImportDeclaration)
|
||||
const lastImportNode = astPath.get(`body.${lastImportIndex > -1 ? lastImportIndex : 0}`)
|
||||
const extraNodes = [
|
||||
importTaroH5Node,
|
||||
//@fix
|
||||
//importTaroH5Node,
|
||||
importMpNode,
|
||||
importRouterNode,
|
||||
initPxTransformNode
|
||||
//@fix
|
||||
//initPxTransformNode
|
||||
]
|
||||
|
||||
astPath.traverse(programExitVisitor)
|
||||
|
||||
if (hasJSX && !hasAddNervJsImportDefaultName) {
|
||||
extraNodes.unshift(importNervjsNode)
|
||||
//@fix
|
||||
//extraNodes.unshift(importNervjsNode)
|
||||
}
|
||||
if (tabBar) {
|
||||
extraNodes.unshift(importComponentNode)
|
||||
|
@ -621,6 +649,11 @@ function processOthers (code, filePath, fileType) {
|
|||
'method', t.identifier('componentDidShow'), [],
|
||||
t.blockStatement([]), false, false))
|
||||
}
|
||||
//@fix
|
||||
astPath.unshiftContainer('body', t.classProperty(
|
||||
t.identifier('static css'),
|
||||
t.identifier('___css')
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -640,12 +673,31 @@ function processOthers (code, filePath, fileType) {
|
|||
}
|
||||
}
|
||||
} : {},
|
||||
//@fix
|
||||
ClassBody:{
|
||||
enter (astPath) {
|
||||
astPath.unshiftContainer('body', t.classProperty(
|
||||
t.identifier('static css'),
|
||||
t.identifier('___css')
|
||||
))
|
||||
}
|
||||
},
|
||||
ImportDeclaration: {
|
||||
enter (astPath) {
|
||||
const node = astPath.node
|
||||
const source = node.source
|
||||
let value = source.value
|
||||
const specifiers = node.specifiers
|
||||
//@fix
|
||||
if(value.endsWith('.css')){
|
||||
let css = fs.readFileSync(filePath.replace('.js','.css'), 'utf-8').replace(/\/\*[^*]*\*+([^/][^*]*\*+)*\//g, '')
|
||||
//page里需要注入 appcss
|
||||
if(filePath.indexOf('/src/pages/')!==-1||filePath.indexOf('\\src\\pages\\')!==-1){
|
||||
css = appCSS + css
|
||||
}
|
||||
astPath.replaceWith(t.variableDeclaration('const',[t.variableDeclarator(t.identifier(`___css`),t.callExpression(t.identifier('Omi.rpx'),[t.stringLiteral(css)]),)]))
|
||||
return
|
||||
}
|
||||
if (Util.isAliasPath(value, pathAlias)) {
|
||||
source.value = value = Util.replaceAliasPath(filePath, value, pathAlias)
|
||||
}
|
||||
|
@ -664,10 +716,11 @@ function processOthers (code, filePath, fileType) {
|
|||
taroImportDefaultName = specifier.local.name
|
||||
specifier.local.name = nervJsImportDefaultName
|
||||
} else if (!hasAddNervJsImportDefaultName) {
|
||||
hasAddNervJsImportDefaultName = true
|
||||
node.specifiers.unshift(
|
||||
t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
)
|
||||
//@fix
|
||||
//hasAddNervJsImportDefaultName = true
|
||||
// node.specifiers.unshift(
|
||||
// t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
// )
|
||||
}
|
||||
const taroApisSpecifiers = []
|
||||
const deletedIdx = []
|
||||
|
@ -705,11 +758,12 @@ function processOthers (code, filePath, fileType) {
|
|||
}
|
||||
const node = astPath.node
|
||||
if (hasJSX && !hasAddNervJsImportDefaultName) {
|
||||
node.body.unshift(
|
||||
t.importDeclaration([
|
||||
t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
], t.stringLiteral(PACKAGES['nervjs']))
|
||||
)
|
||||
//@fix
|
||||
// node.body.unshift(
|
||||
// t.importDeclaration([
|
||||
// t.importDefaultSpecifier(t.identifier(nervJsImportDefaultName))
|
||||
// ], t.stringLiteral(PACKAGES['nervjs']))
|
||||
// )
|
||||
}
|
||||
if (taroImportDefaultName) {
|
||||
const importTaro = toAst(`import ${taroImportDefaultName} from '${PACKAGES['@tarojs/taro-h5']}'`)
|
||||
|
|
|
@ -163,6 +163,8 @@ exports.CONFIG_MAP = {
|
|||
}
|
||||
|
||||
exports.PROJECT_CONFIG = 'config/index.js'
|
||||
//@fix
|
||||
exports.PROJECT_CONFIG_H5 = 'config/h5.js'
|
||||
|
||||
exports.DEVICE_RATIO = {
|
||||
'640': 2.34 / 2,
|
||||
|
|
|
@ -70,4 +70,4 @@ define('my-app', class extends WeElement {
|
|||
})
|
||||
|
||||
|
||||
render(<my-app />, 'body')
|
||||
render(<my-app />, '#app')
|
||||
|
|
|
@ -10,14 +10,14 @@ define('my-element', class extends WeElement {
|
|||
clickHandler = () => {
|
||||
console.log('clicked' + this.a)
|
||||
|
||||
// this.data.arr[0] = Math.random()
|
||||
// this.data.arr[1] = Math.random()
|
||||
// this.update()
|
||||
//上面代码等同于:
|
||||
this.update({
|
||||
'arr[0]': Math.random(),
|
||||
"arr[1]": Math.random()
|
||||
})
|
||||
this.data.arr[0] = Math.random()
|
||||
this.data.arr[1] = Math.random()
|
||||
this.update()
|
||||
//上面代码等同于,注意 h5 不支持下面方式更新
|
||||
// this.update({
|
||||
// 'arr[0]': Math.random(),
|
||||
// "arr[1]": Math.random()
|
||||
// })
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
@ -8,10 +8,8 @@
|
|||
<meta name="format-detection" content="telephone=no,address=no">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="white">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
|
||||
<title>Taro</title>
|
||||
<script>
|
||||
!function(x){function w(){var v,u,t,tes,s=x.document,r=s.documentElement,a=r.getBoundingClientRect().width;if(!v&&!u){var n=!!x.navigator.appVersion.match(/AppleWebKit.*Mobile.*/);v=x.devicePixelRatio;tes=x.devicePixelRatio;v=n?v:1,u=1/v}if(a>=640){r.style.fontSize="40px"}else{if(a<=320){r.style.fontSize="20px"}else{r.style.fontSize=a/320*20+"px"}}}x.addEventListener("resize",function(){w()});w()}(window);
|
||||
</script>
|
||||
<link rel="shortcut icon" href="https://tencent.github.io/omi/packages/omiu/examples/build/favicon.ico">
|
||||
<title>Omi</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
window.getApp = function () {
|
||||
return {
|
||||
globalData: {
|
||||
userInfo: {
|
||||
avatarUrl: 'https://github.com/Tencent/omi/raw/master/assets/omi-logo-140.png?sanitize=true',
|
||||
nickName: 'dntzhang(张磊)'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
import './wx'
|
||||
import './get-app'
|
|
@ -0,0 +1,182 @@
|
|||
import { render } from 'omi'
|
||||
import ajax from '@fdaciuk/ajax'
|
||||
|
||||
|
||||
function noop() { }
|
||||
|
||||
const wx = {}
|
||||
|
||||
wx.canIUse = function () {
|
||||
return false
|
||||
}
|
||||
|
||||
wx.getStorageSync = noop
|
||||
wx.setStorageSync = noop
|
||||
wx.login = noop
|
||||
wx.getSetting = noop
|
||||
|
||||
wx.getSystemInfoSync = function () {
|
||||
return {
|
||||
windowWidth: window.innerWidth,
|
||||
windowHeight: window.innerHeight,
|
||||
pixelRatio: window.devicePixelRadio
|
||||
}
|
||||
}
|
||||
|
||||
wx.getSystemInfo = function (options) {
|
||||
options.success({
|
||||
windowWidth: window.innerWidth,
|
||||
windowHeight: window.innerHeight,
|
||||
pixelRatio: window.devicePixelRadio
|
||||
})
|
||||
}
|
||||
|
||||
wx.getUserInfo = function () {
|
||||
console.warn('wx.getUserInfo method cannot be invoked in browser.')
|
||||
}
|
||||
|
||||
wx.navigateTo = function (option) {
|
||||
route.query = getUrlParams(option.url)
|
||||
route.to(option.url.replace('../','/pages/'), option)
|
||||
}
|
||||
|
||||
function getUrlParam(name, url) {
|
||||
if (!name) {
|
||||
return ''
|
||||
}
|
||||
url = url || location.search
|
||||
name = name.replace(/(?=[\\^$*+?.():|{}])/, '\\')
|
||||
var reg = new RegExp('(?:[?&]|^)' + name + '=([^?&#]*)', 'i')
|
||||
var match = url.match(reg)
|
||||
return !match ? '' : match[1]
|
||||
}
|
||||
|
||||
wx.setNavigationBarTitle = function (option) {
|
||||
document.title = option.title
|
||||
}
|
||||
|
||||
wx.navigateBack = function (option) {
|
||||
history.go(option.delta * -1)
|
||||
}
|
||||
|
||||
function getUrlParams(url) {
|
||||
url = url.replace(/#.*$/, '')
|
||||
var queryArray = url.split(/[?&]/).slice(1)
|
||||
var i, args = {}
|
||||
for (i = 0; i < queryArray.length; i++) {
|
||||
var match = queryArray[i].match(/([^=]+)=([^=]+)/)
|
||||
if (match !== null) {
|
||||
args[match[1]] = decodeURIComponent(match[2])
|
||||
}
|
||||
}
|
||||
return args
|
||||
}
|
||||
|
||||
wx.currentPage = null
|
||||
|
||||
export function routeUpdate(vnode, selector, byNative, root) {
|
||||
root.childNodes.forEach(child => {
|
||||
if (child.style.display !== 'none') {
|
||||
child.style.display = 'none'
|
||||
child.onHide && child.onHide()
|
||||
}
|
||||
})
|
||||
if (byNative) {
|
||||
const ele = document.querySelector(selector)
|
||||
if (ele) {
|
||||
ele.style.display = 'block'
|
||||
ele.onShow && ele.onShow()
|
||||
wx.currentPage = ele
|
||||
document.documentElement.scrollTop = ele._preScrollTop
|
||||
document.body.scrollTop = ele._preScrollTop
|
||||
//set twice
|
||||
setTimeout(function () {
|
||||
document.documentElement.scrollTop = ele._preScrollTop
|
||||
document.body.scrollTop = ele._preScrollTop
|
||||
}, 0)
|
||||
} else {
|
||||
const node = render(vnode, root)
|
||||
node.onShow && node.onShow()
|
||||
wx.currentPage = node
|
||||
document.documentElement.scrollTop = 0
|
||||
document.body.scrollTop = 0
|
||||
}
|
||||
} else {
|
||||
const ele = document.querySelector(selector)
|
||||
ele && ele.parentNode.removeChild(ele)
|
||||
const node = render(vnode, root)
|
||||
node.onShow && node.onShow()
|
||||
wx.currentPage = node
|
||||
document.documentElement.scrollTop = 0
|
||||
document.body.scrollTop = 0
|
||||
}
|
||||
}
|
||||
|
||||
wx.request = function (options) {
|
||||
const request = ajax({
|
||||
method: options.method || 'GET',
|
||||
url: options.url,
|
||||
data: options.data,
|
||||
headers: options.header
|
||||
})
|
||||
|
||||
request.then((data, xhr) => {
|
||||
options.success({
|
||||
data: data,
|
||||
statusCode: xhr.status
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
wx._bindReachBottom = function (callback, context) {
|
||||
window.addEventListener('scroll', () => {
|
||||
if (getScrollHeight() - getScrollTop() - getWindowHeight() < 30) {
|
||||
if(context === wx.currentPage){
|
||||
throttle(callback, context)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getScrollHeight() {
|
||||
var scrollHeight = 0, bodyScrollHeight = 0, documentScrollHeight = 0;
|
||||
if (document.body) {
|
||||
bodyScrollHeight = document.body.scrollHeight;
|
||||
}
|
||||
if (document.documentElement) {
|
||||
documentScrollHeight = document.documentElement.scrollHeight;
|
||||
}
|
||||
scrollHeight = (bodyScrollHeight - documentScrollHeight > 0) ? bodyScrollHeight : documentScrollHeight;
|
||||
return scrollHeight;
|
||||
}
|
||||
|
||||
function getScrollTop() {
|
||||
var scrollTop = 0, bodyScrollTop = 0, documentScrollTop = 0;
|
||||
if (document.body) {
|
||||
bodyScrollTop = document.body.scrollTop;
|
||||
}
|
||||
if (document.documentElement) {
|
||||
documentScrollTop = document.documentElement.scrollTop;
|
||||
}
|
||||
scrollTop = (bodyScrollTop - documentScrollTop > 0) ? bodyScrollTop : documentScrollTop;
|
||||
return scrollTop;
|
||||
}
|
||||
|
||||
function getWindowHeight() {
|
||||
var windowHeight = 0;
|
||||
if (document.compatMode == "CSS1Compat") {
|
||||
windowHeight = document.documentElement.clientHeight;
|
||||
} else {
|
||||
windowHeight = document.body.clientHeight;
|
||||
}
|
||||
return windowHeight;
|
||||
}
|
||||
|
||||
function throttle(method, scope) {
|
||||
clearTimeout(method.tId);
|
||||
method.tId= setTimeout(function(){
|
||||
method.call(scope);
|
||||
}, 300);
|
||||
}
|
||||
|
||||
window.wx = wx
|
|
@ -0,0 +1,976 @@
|
|||
export = Omi;
|
||||
export as namespace Omi;
|
||||
|
||||
declare namespace Omi {
|
||||
type Callback = (...args: any[]) => void;
|
||||
type Key = string | number;
|
||||
type Ref<T> = (instance: T) => void;
|
||||
type ComponentChild = VNode<any> | object | string | number | boolean | null;
|
||||
type ComponentChildren = ComponentChild[] | ComponentChild;
|
||||
|
||||
interface Attributes {
|
||||
key?: string | number | any;
|
||||
}
|
||||
|
||||
interface ClassAttributes<T> extends Attributes {
|
||||
ref?: Ref<T>;
|
||||
}
|
||||
|
||||
interface OmiDOMAttributes {
|
||||
children?: ComponentChildren;
|
||||
dangerouslySetInnerHTML?: {
|
||||
__html: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this to manually set the attributes of a custom element
|
||||
*
|
||||
* declare global {
|
||||
* namespace JSX {
|
||||
* interface IntrinsicElements {
|
||||
* 'hello-element': CustomElementBaseAttributes & {
|
||||
* propFromParent: string;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
interface CustomElementBaseAttributes extends ClassAttributes<any>, OmiDOMAttributes {}
|
||||
|
||||
/**
|
||||
* Define the contract for a virtual node in omi.
|
||||
*
|
||||
* A virtual node has a name, a map of attributes, an array
|
||||
* of child {VNode}s and a key. The key is used by omi for
|
||||
* internal purposes.
|
||||
*/
|
||||
interface VNode<P = any> {
|
||||
nodeName: string;
|
||||
attributes: P;
|
||||
children: Array<VNode<any> | string>;
|
||||
key?: Key | null;
|
||||
}
|
||||
|
||||
type RenderableProps<P, RefType = any> = Readonly<
|
||||
P & Attributes & { children?: ComponentChildren; ref?: Ref<RefType> }
|
||||
>;
|
||||
|
||||
interface WeElement<P, D> {
|
||||
install?(): void;
|
||||
installed?(): void;
|
||||
uninstall?(): void;
|
||||
beforeUpdate?(): void;
|
||||
afterUpdate?(): void;
|
||||
updated?(): void;
|
||||
beforeRender?(): void;
|
||||
receiveProps?(): void;
|
||||
}
|
||||
|
||||
interface ModelView<P, D> {
|
||||
install?(): void;
|
||||
installed?(): void;
|
||||
uninstall?(): void;
|
||||
beforeUpdate?(): void;
|
||||
afterUpdate?(): void;
|
||||
updated?(): void;
|
||||
beforeRender?(): void;
|
||||
receiveProps?(): void;
|
||||
}
|
||||
|
||||
interface Component<P, D> {
|
||||
install?(): void;
|
||||
installed?(): void;
|
||||
uninstall?(): void;
|
||||
beforeUpdate?(): void;
|
||||
afterUpdate?(): void;
|
||||
updated?(): void;
|
||||
beforeRender?(): void;
|
||||
receiveProps?(): void;
|
||||
}
|
||||
|
||||
abstract class WeElement<P = {}, D = {}> {
|
||||
constructor();
|
||||
|
||||
// Allow static members to reference class type parameters
|
||||
// https://github.com/Microsoft/TypeScript/issues/24018
|
||||
static props: object;
|
||||
static data: object;
|
||||
static observe: boolean;
|
||||
static mergeUpdate: boolean;
|
||||
static css: string;
|
||||
|
||||
props: RenderableProps<P>;
|
||||
data: D;
|
||||
host: HTMLElement;
|
||||
|
||||
update(): void;
|
||||
fire(name: string, data?: object): void;
|
||||
|
||||
// Abstract methods don't infer argument types
|
||||
// https://github.com/Microsoft/TypeScript/issues/14887
|
||||
abstract render(props: RenderableProps<P>, data: D): void;
|
||||
}
|
||||
|
||||
// The class type (not instance of class)
|
||||
// https://stackoverflow.com/q/42753968/2777142
|
||||
interface WeElementConstructor {
|
||||
new(): WeElement;
|
||||
}
|
||||
|
||||
abstract class ModelView<P = {}, D = {}> {
|
||||
constructor();
|
||||
|
||||
// Allow static members to reference class type parameters
|
||||
// https://github.com/Microsoft/TypeScript/issues/24018
|
||||
static props: object;
|
||||
static data: object;
|
||||
static observe: boolean;
|
||||
static mergeUpdate: boolean;
|
||||
|
||||
props: RenderableProps<P>;
|
||||
data: D;
|
||||
host: HTMLElement;
|
||||
|
||||
update(): void;
|
||||
fire(name: string, data?: object): void;
|
||||
|
||||
// Abstract methods don't infer argument types
|
||||
// https://github.com/Microsoft/TypeScript/issues/14887
|
||||
abstract render(props: RenderableProps<P>, data: D): void;
|
||||
}
|
||||
|
||||
abstract class Component<P = {}, D = {}> {
|
||||
constructor();
|
||||
|
||||
// Allow static members to reference class type parameters
|
||||
// https://github.com/Microsoft/TypeScript/issues/24018
|
||||
static props: object;
|
||||
static data: object;
|
||||
static observe: boolean;
|
||||
static mergeUpdate: boolean;
|
||||
static css: string;
|
||||
|
||||
props: RenderableProps<P>;
|
||||
data: D;
|
||||
host: HTMLElement;
|
||||
|
||||
update(): void;
|
||||
fire(name: string, data?: object): void;
|
||||
|
||||
// Abstract methods don't infer argument types
|
||||
// https://github.com/Microsoft/TypeScript/issues/14887
|
||||
abstract render(props: RenderableProps<P>, data: D): void;
|
||||
}
|
||||
|
||||
function h<P>(
|
||||
node: string,
|
||||
params: Attributes & P | null,
|
||||
...children: ComponentChildren[]
|
||||
): VNode<any>;
|
||||
function h(
|
||||
node: string,
|
||||
params: JSX.HTMLAttributes & JSX.SVGAttributes & Record<string, any> | null,
|
||||
...children: ComponentChildren[]
|
||||
): VNode<any>;
|
||||
|
||||
function render(vnode: ComponentChild, parent: string | Element | Document | ShadowRoot | DocumentFragment, store?: object, empty?: boolean, merge?: string | Element | Document | ShadowRoot | DocumentFragment): void;
|
||||
|
||||
function define(name: string, ctor: WeElementConstructor): void;
|
||||
function tag(name: string, pure?: boolean): (ctor: WeElementConstructor) => void;
|
||||
function tick(callback: Callback, scope?: any): void;
|
||||
function nextTick(callback: Callback, scope?: any): void;
|
||||
function observe(target: WeElementConstructor): void;
|
||||
function getHost(element: WeElement): WeElement;
|
||||
|
||||
var options: {
|
||||
vnode?: (vnode: VNode<any>) => void;
|
||||
event?: (event: Event) => Event;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
type Defaultize<Props, Defaults> =
|
||||
// Distribute over unions
|
||||
Props extends any
|
||||
? // Make any properties included in Default optional
|
||||
& Partial<Pick<Props, Extract<keyof Props, keyof Defaults>>>
|
||||
// Include the remaining properties from Props
|
||||
& Pick<Props, Exclude<keyof Props, keyof Defaults>>
|
||||
: never;
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
interface Element extends Omi.VNode<any> {
|
||||
}
|
||||
|
||||
interface ElementClass extends Omi.WeElement<any, any> {
|
||||
}
|
||||
|
||||
interface ElementClass extends Omi.Component<any, any> {
|
||||
}
|
||||
|
||||
interface ElementAttributesProperty {
|
||||
props: any;
|
||||
}
|
||||
|
||||
interface ElementChildrenAttribute {
|
||||
children: any;
|
||||
}
|
||||
|
||||
type LibraryManagedAttributes<Component, Props> =
|
||||
Component extends { defaultProps: infer Defaults }
|
||||
? Defaultize<Props, Defaults>
|
||||
: Props;
|
||||
|
||||
interface SVGAttributes extends HTMLAttributes {
|
||||
accentHeight?: number | string;
|
||||
accumulate?: "none" | "sum";
|
||||
additive?: "replace" | "sum";
|
||||
alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit";
|
||||
allowReorder?: "no" | "yes";
|
||||
alphabetic?: number | string;
|
||||
amplitude?: number | string;
|
||||
arabicForm?: "initial" | "medial" | "terminal" | "isolated";
|
||||
ascent?: number | string;
|
||||
attributeName?: string;
|
||||
attributeType?: string;
|
||||
autoReverse?: number | string;
|
||||
azimuth?: number | string;
|
||||
baseFrequency?: number | string;
|
||||
baselineShift?: number | string;
|
||||
baseProfile?: number | string;
|
||||
bbox?: number | string;
|
||||
begin?: number | string;
|
||||
bias?: number | string;
|
||||
by?: number | string;
|
||||
calcMode?: number | string;
|
||||
capHeight?: number | string;
|
||||
clip?: number | string;
|
||||
clipPath?: string;
|
||||
clipPathUnits?: number | string;
|
||||
clipRule?: number | string;
|
||||
colorInterpolation?: number | string;
|
||||
colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit";
|
||||
colorProfile?: number | string;
|
||||
colorRendering?: number | string;
|
||||
contentScriptType?: number | string;
|
||||
contentStyleType?: number | string;
|
||||
cursor?: number | string;
|
||||
cx?: number | string;
|
||||
cy?: number | string;
|
||||
d?: string;
|
||||
decelerate?: number | string;
|
||||
descent?: number | string;
|
||||
diffuseConstant?: number | string;
|
||||
direction?: number | string;
|
||||
display?: number | string;
|
||||
divisor?: number | string;
|
||||
dominantBaseline?: number | string;
|
||||
dur?: number | string;
|
||||
dx?: number | string;
|
||||
dy?: number | string;
|
||||
edgeMode?: number | string;
|
||||
elevation?: number | string;
|
||||
enableBackground?: number | string;
|
||||
end?: number | string;
|
||||
exponent?: number | string;
|
||||
externalResourcesRequired?: number | string;
|
||||
fill?: string;
|
||||
fillOpacity?: number | string;
|
||||
fillRule?: "nonzero" | "evenodd" | "inherit";
|
||||
filter?: string;
|
||||
filterRes?: number | string;
|
||||
filterUnits?: number | string;
|
||||
floodColor?: number | string;
|
||||
floodOpacity?: number | string;
|
||||
focusable?: number | string;
|
||||
fontFamily?: string;
|
||||
fontSize?: number | string;
|
||||
fontSizeAdjust?: number | string;
|
||||
fontStretch?: number | string;
|
||||
fontStyle?: number | string;
|
||||
fontVariant?: number | string;
|
||||
fontWeight?: number | string;
|
||||
format?: number | string;
|
||||
from?: number | string;
|
||||
fx?: number | string;
|
||||
fy?: number | string;
|
||||
g1?: number | string;
|
||||
g2?: number | string;
|
||||
glyphName?: number | string;
|
||||
glyphOrientationHorizontal?: number | string;
|
||||
glyphOrientationVertical?: number | string;
|
||||
glyphRef?: number | string;
|
||||
gradientTransform?: string;
|
||||
gradientUnits?: string;
|
||||
hanging?: number | string;
|
||||
horizAdvX?: number | string;
|
||||
horizOriginX?: number | string;
|
||||
ideographic?: number | string;
|
||||
imageRendering?: number | string;
|
||||
in2?: number | string;
|
||||
in?: string;
|
||||
intercept?: number | string;
|
||||
k1?: number | string;
|
||||
k2?: number | string;
|
||||
k3?: number | string;
|
||||
k4?: number | string;
|
||||
k?: number | string;
|
||||
kernelMatrix?: number | string;
|
||||
kernelUnitLength?: number | string;
|
||||
kerning?: number | string;
|
||||
keyPoints?: number | string;
|
||||
keySplines?: number | string;
|
||||
keyTimes?: number | string;
|
||||
lengthAdjust?: number | string;
|
||||
letterSpacing?: number | string;
|
||||
lightingColor?: number | string;
|
||||
limitingConeAngle?: number | string;
|
||||
local?: number | string;
|
||||
markerEnd?: string;
|
||||
markerHeight?: number | string;
|
||||
markerMid?: string;
|
||||
markerStart?: string;
|
||||
markerUnits?: number | string;
|
||||
markerWidth?: number | string;
|
||||
mask?: string;
|
||||
maskContentUnits?: number | string;
|
||||
maskUnits?: number | string;
|
||||
mathematical?: number | string;
|
||||
mode?: number | string;
|
||||
numOctaves?: number | string;
|
||||
offset?: number | string;
|
||||
opacity?: number | string;
|
||||
operator?: number | string;
|
||||
order?: number | string;
|
||||
orient?: number | string;
|
||||
orientation?: number | string;
|
||||
origin?: number | string;
|
||||
overflow?: number | string;
|
||||
overlinePosition?: number | string;
|
||||
overlineThickness?: number | string;
|
||||
paintOrder?: number | string;
|
||||
panose1?: number | string;
|
||||
pathLength?: number | string;
|
||||
patternContentUnits?: string;
|
||||
patternTransform?: number | string;
|
||||
patternUnits?: string;
|
||||
pointerEvents?: number | string;
|
||||
points?: string;
|
||||
pointsAtX?: number | string;
|
||||
pointsAtY?: number | string;
|
||||
pointsAtZ?: number | string;
|
||||
preserveAlpha?: number | string;
|
||||
preserveAspectRatio?: string;
|
||||
primitiveUnits?: number | string;
|
||||
r?: number | string;
|
||||
radius?: number | string;
|
||||
refX?: number | string;
|
||||
refY?: number | string;
|
||||
renderingIntent?: number | string;
|
||||
repeatCount?: number | string;
|
||||
repeatDur?: number | string;
|
||||
requiredExtensions?: number | string;
|
||||
requiredFeatures?: number | string;
|
||||
restart?: number | string;
|
||||
result?: string;
|
||||
rotate?: number | string;
|
||||
rx?: number | string;
|
||||
ry?: number | string;
|
||||
scale?: number | string;
|
||||
seed?: number | string;
|
||||
shapeRendering?: number | string;
|
||||
slope?: number | string;
|
||||
spacing?: number | string;
|
||||
specularConstant?: number | string;
|
||||
specularExponent?: number | string;
|
||||
speed?: number | string;
|
||||
spreadMethod?: string;
|
||||
startOffset?: number | string;
|
||||
stdDeviation?: number | string;
|
||||
stemh?: number | string;
|
||||
stemv?: number | string;
|
||||
stitchTiles?: number | string;
|
||||
stopColor?: string;
|
||||
stopOpacity?: number | string;
|
||||
strikethroughPosition?: number | string;
|
||||
strikethroughThickness?: number | string;
|
||||
string?: number | string;
|
||||
stroke?: string;
|
||||
strokeDasharray?: string | number;
|
||||
strokeDashoffset?: string | number;
|
||||
strokeLinecap?: "butt" | "round" | "square" | "inherit";
|
||||
strokeLinejoin?: "miter" | "round" | "bevel" | "inherit";
|
||||
strokeMiterlimit?: string;
|
||||
strokeOpacity?: number | string;
|
||||
strokeWidth?: number | string;
|
||||
surfaceScale?: number | string;
|
||||
systemLanguage?: number | string;
|
||||
tableValues?: number | string;
|
||||
targetX?: number | string;
|
||||
targetY?: number | string;
|
||||
textAnchor?: string;
|
||||
textDecoration?: number | string;
|
||||
textLength?: number | string;
|
||||
textRendering?: number | string;
|
||||
to?: number | string;
|
||||
transform?: string;
|
||||
u1?: number | string;
|
||||
u2?: number | string;
|
||||
underlinePosition?: number | string;
|
||||
underlineThickness?: number | string;
|
||||
unicode?: number | string;
|
||||
unicodeBidi?: number | string;
|
||||
unicodeRange?: number | string;
|
||||
unitsPerEm?: number | string;
|
||||
vAlphabetic?: number | string;
|
||||
values?: string;
|
||||
vectorEffect?: number | string;
|
||||
version?: string;
|
||||
vertAdvY?: number | string;
|
||||
vertOriginX?: number | string;
|
||||
vertOriginY?: number | string;
|
||||
vHanging?: number | string;
|
||||
vIdeographic?: number | string;
|
||||
viewBox?: string;
|
||||
viewTarget?: number | string;
|
||||
visibility?: number | string;
|
||||
vMathematical?: number | string;
|
||||
widths?: number | string;
|
||||
wordSpacing?: number | string;
|
||||
writingMode?: number | string;
|
||||
x1?: number | string;
|
||||
x2?: number | string;
|
||||
x?: number | string;
|
||||
xChannelSelector?: string;
|
||||
xHeight?: number | string;
|
||||
xlinkActuate?: string;
|
||||
xlinkArcrole?: string;
|
||||
xlinkHref?: string;
|
||||
xlinkRole?: string;
|
||||
xlinkShow?: string;
|
||||
xlinkTitle?: string;
|
||||
xlinkType?: string;
|
||||
xmlBase?: string;
|
||||
xmlLang?: string;
|
||||
xmlns?: string;
|
||||
xmlnsXlink?: string;
|
||||
xmlSpace?: string;
|
||||
y1?: number | string;
|
||||
y2?: number | string;
|
||||
y?: number | string;
|
||||
yChannelSelector?: string;
|
||||
z?: number | string;
|
||||
zoomAndPan?: string;
|
||||
}
|
||||
|
||||
interface PathAttributes {
|
||||
d: string;
|
||||
}
|
||||
|
||||
interface EventHandler<E extends Event> {
|
||||
(event: E): void;
|
||||
}
|
||||
|
||||
type ClipboardEventHandler = EventHandler<ClipboardEvent>;
|
||||
type CompositionEventHandler = EventHandler<CompositionEvent>;
|
||||
type DragEventHandler = EventHandler<DragEvent>;
|
||||
type FocusEventHandler = EventHandler<FocusEvent>;
|
||||
type KeyboardEventHandler = EventHandler<KeyboardEvent>;
|
||||
type MouseEventHandler = EventHandler<MouseEvent>;
|
||||
type TouchEventHandler = EventHandler<TouchEvent>;
|
||||
type UIEventHandler = EventHandler<UIEvent>;
|
||||
type WheelEventHandler = EventHandler<WheelEvent>;
|
||||
type AnimationEventHandler = EventHandler<AnimationEvent>;
|
||||
type TransitionEventHandler = EventHandler<TransitionEvent>;
|
||||
type GenericEventHandler = EventHandler<Event>;
|
||||
type PointerEventHandler = EventHandler<PointerEvent>;
|
||||
|
||||
interface DOMAttributes extends Omi.OmiDOMAttributes {
|
||||
// Image Events
|
||||
onLoad?: GenericEventHandler;
|
||||
onError?: GenericEventHandler;
|
||||
onLoadCapture?: GenericEventHandler;
|
||||
|
||||
// Clipboard Events
|
||||
onCopy?: ClipboardEventHandler;
|
||||
onCopyCapture?: ClipboardEventHandler;
|
||||
onCut?: ClipboardEventHandler;
|
||||
onCutCapture?: ClipboardEventHandler;
|
||||
onPaste?: ClipboardEventHandler;
|
||||
onPasteCapture?: ClipboardEventHandler;
|
||||
|
||||
// Composition Events
|
||||
onCompositionEnd?: CompositionEventHandler;
|
||||
onCompositionEndCapture?: CompositionEventHandler;
|
||||
onCompositionStart?: CompositionEventHandler;
|
||||
onCompositionStartCapture?: CompositionEventHandler;
|
||||
onCompositionUpdate?: CompositionEventHandler;
|
||||
onCompositionUpdateCapture?: CompositionEventHandler;
|
||||
|
||||
// Focus Events
|
||||
onFocus?: FocusEventHandler;
|
||||
onFocusCapture?: FocusEventHandler;
|
||||
onBlur?: FocusEventHandler;
|
||||
onBlurCapture?: FocusEventHandler;
|
||||
|
||||
// Form Events
|
||||
onChange?: GenericEventHandler;
|
||||
onChangeCapture?: GenericEventHandler;
|
||||
onInput?: GenericEventHandler;
|
||||
onInputCapture?: GenericEventHandler;
|
||||
onSearch?: GenericEventHandler;
|
||||
onSearchCapture?: GenericEventHandler;
|
||||
onSubmit?: GenericEventHandler;
|
||||
onSubmitCapture?: GenericEventHandler;
|
||||
|
||||
// Keyboard Events
|
||||
onKeyDown?: KeyboardEventHandler;
|
||||
onKeyDownCapture?: KeyboardEventHandler;
|
||||
onKeyPress?: KeyboardEventHandler;
|
||||
onKeyPressCapture?: KeyboardEventHandler;
|
||||
onKeyUp?: KeyboardEventHandler;
|
||||
onKeyUpCapture?: KeyboardEventHandler;
|
||||
|
||||
// Media Events
|
||||
onAbort?: GenericEventHandler;
|
||||
onAbortCapture?: GenericEventHandler;
|
||||
onCanPlay?: GenericEventHandler;
|
||||
onCanPlayCapture?: GenericEventHandler;
|
||||
onCanPlayThrough?: GenericEventHandler;
|
||||
onCanPlayThroughCapture?: GenericEventHandler;
|
||||
onDurationChange?: GenericEventHandler;
|
||||
onDurationChangeCapture?: GenericEventHandler;
|
||||
onEmptied?: GenericEventHandler;
|
||||
onEmptiedCapture?: GenericEventHandler;
|
||||
onEncrypted?: GenericEventHandler;
|
||||
onEncryptedCapture?: GenericEventHandler;
|
||||
onEnded?: GenericEventHandler;
|
||||
onEndedCapture?: GenericEventHandler;
|
||||
onLoadedData?: GenericEventHandler;
|
||||
onLoadedDataCapture?: GenericEventHandler;
|
||||
onLoadedMetadata?: GenericEventHandler;
|
||||
onLoadedMetadataCapture?: GenericEventHandler;
|
||||
onLoadStart?: GenericEventHandler;
|
||||
onLoadStartCapture?: GenericEventHandler;
|
||||
onPause?: GenericEventHandler;
|
||||
onPauseCapture?: GenericEventHandler;
|
||||
onPlay?: GenericEventHandler;
|
||||
onPlayCapture?: GenericEventHandler;
|
||||
onPlaying?: GenericEventHandler;
|
||||
onPlayingCapture?: GenericEventHandler;
|
||||
onProgress?: GenericEventHandler;
|
||||
onProgressCapture?: GenericEventHandler;
|
||||
onRateChange?: GenericEventHandler;
|
||||
onRateChangeCapture?: GenericEventHandler;
|
||||
onSeeked?: GenericEventHandler;
|
||||
onSeekedCapture?: GenericEventHandler;
|
||||
onSeeking?: GenericEventHandler;
|
||||
onSeekingCapture?: GenericEventHandler;
|
||||
onStalled?: GenericEventHandler;
|
||||
onStalledCapture?: GenericEventHandler;
|
||||
onSuspend?: GenericEventHandler;
|
||||
onSuspendCapture?: GenericEventHandler;
|
||||
onTimeUpdate?: GenericEventHandler;
|
||||
onTimeUpdateCapture?: GenericEventHandler;
|
||||
onVolumeChange?: GenericEventHandler;
|
||||
onVolumeChangeCapture?: GenericEventHandler;
|
||||
onWaiting?: GenericEventHandler;
|
||||
onWaitingCapture?: GenericEventHandler;
|
||||
|
||||
// MouseEvents
|
||||
onClick?: MouseEventHandler;
|
||||
onClickCapture?: MouseEventHandler;
|
||||
onContextMenu?: MouseEventHandler;
|
||||
onContextMenuCapture?: MouseEventHandler;
|
||||
onDblClick?: MouseEventHandler;
|
||||
onDblClickCapture?: MouseEventHandler;
|
||||
onDrag?: DragEventHandler;
|
||||
onDragCapture?: DragEventHandler;
|
||||
onDragEnd?: DragEventHandler;
|
||||
onDragEndCapture?: DragEventHandler;
|
||||
onDragEnter?: DragEventHandler;
|
||||
onDragEnterCapture?: DragEventHandler;
|
||||
onDragExit?: DragEventHandler;
|
||||
onDragExitCapture?: DragEventHandler;
|
||||
onDragLeave?: DragEventHandler;
|
||||
onDragLeaveCapture?: DragEventHandler;
|
||||
onDragOver?: DragEventHandler;
|
||||
onDragOverCapture?: DragEventHandler;
|
||||
onDragStart?: DragEventHandler;
|
||||
onDragStartCapture?: DragEventHandler;
|
||||
onDrop?: DragEventHandler;
|
||||
onDropCapture?: DragEventHandler;
|
||||
onMouseDown?: MouseEventHandler;
|
||||
onMouseDownCapture?: MouseEventHandler;
|
||||
onMouseEnter?: MouseEventHandler;
|
||||
onMouseEnterCapture?: MouseEventHandler;
|
||||
onMouseLeave?: MouseEventHandler;
|
||||
onMouseLeaveCapture?: MouseEventHandler;
|
||||
onMouseMove?: MouseEventHandler;
|
||||
onMouseMoveCapture?: MouseEventHandler;
|
||||
onMouseOut?: MouseEventHandler;
|
||||
onMouseOutCapture?: MouseEventHandler;
|
||||
onMouseOver?: MouseEventHandler;
|
||||
onMouseOverCapture?: MouseEventHandler;
|
||||
onMouseUp?: MouseEventHandler;
|
||||
onMouseUpCapture?: MouseEventHandler;
|
||||
|
||||
// Selection Events
|
||||
onSelect?: GenericEventHandler;
|
||||
onSelectCapture?: GenericEventHandler;
|
||||
|
||||
// Touch Events
|
||||
onTouchCancel?: TouchEventHandler;
|
||||
onTouchCancelCapture?: TouchEventHandler;
|
||||
onTouchEnd?: TouchEventHandler;
|
||||
onTouchEndCapture?: TouchEventHandler;
|
||||
onTouchMove?: TouchEventHandler;
|
||||
onTouchMoveCapture?: TouchEventHandler;
|
||||
onTouchStart?: TouchEventHandler;
|
||||
onTouchStartCapture?: TouchEventHandler;
|
||||
|
||||
// Pointer Events
|
||||
onPointerOver?: PointerEventHandler;
|
||||
onPointerOverCapture?: PointerEventHandler;
|
||||
onPointerEnter?: PointerEventHandler;
|
||||
onPointerEnterCapture?: PointerEventHandler;
|
||||
onPointerDown?: PointerEventHandler;
|
||||
onPointerDownCapture?: PointerEventHandler;
|
||||
onPointerMove?: PointerEventHandler;
|
||||
onPointerMoveCapture?: PointerEventHandler;
|
||||
onPointerUp?: PointerEventHandler;
|
||||
onPointerUpCapture?: PointerEventHandler;
|
||||
onPointerCancel?: PointerEventHandler;
|
||||
onPointerCancelCapture?: PointerEventHandler;
|
||||
onPointerOut?: PointerEventHandler;
|
||||
onPointerOutCapture?: PointerEventHandler;
|
||||
onPointerLeave?: PointerEventHandler;
|
||||
onPointerLeaveCapture?: PointerEventHandler;
|
||||
onGotPointerCapture?: PointerEventHandler;
|
||||
onGotPointerCaptureCapture?: PointerEventHandler;
|
||||
onLostPointerCapture?: PointerEventHandler;
|
||||
onLostPointerCaptureCapture?: PointerEventHandler;
|
||||
|
||||
// UI Events
|
||||
onScroll?: UIEventHandler;
|
||||
onScrollCapture?: UIEventHandler;
|
||||
|
||||
// Wheel Events
|
||||
onWheel?: WheelEventHandler;
|
||||
onWheelCapture?: WheelEventHandler;
|
||||
|
||||
// Animation Events
|
||||
onAnimationStart?: AnimationEventHandler;
|
||||
onAnimationStartCapture?: AnimationEventHandler;
|
||||
onAnimationEnd?: AnimationEventHandler;
|
||||
onAnimationEndCapture?: AnimationEventHandler;
|
||||
onAnimationIteration?: AnimationEventHandler;
|
||||
onAnimationIterationCapture?: AnimationEventHandler;
|
||||
|
||||
// Transition Events
|
||||
onTransitionEnd?: TransitionEventHandler;
|
||||
onTransitionEndCapture?: TransitionEventHandler;
|
||||
}
|
||||
|
||||
interface HTMLAttributes extends Omi.ClassAttributes<any>, DOMAttributes {
|
||||
// Standard HTML Attributes
|
||||
accept?: string;
|
||||
acceptCharset?: string;
|
||||
accessKey?: string;
|
||||
action?: string;
|
||||
allowFullScreen?: boolean;
|
||||
allowTransparency?: boolean;
|
||||
alt?: string;
|
||||
async?: boolean;
|
||||
autocomplete?: string;
|
||||
autofocus?: boolean;
|
||||
autoPlay?: boolean;
|
||||
capture?: boolean;
|
||||
cellPadding?: number | string;
|
||||
cellSpacing?: number | string;
|
||||
charSet?: string;
|
||||
challenge?: string;
|
||||
checked?: boolean;
|
||||
class?: string;
|
||||
className?: string;
|
||||
cols?: number;
|
||||
colSpan?: number;
|
||||
content?: string;
|
||||
contentEditable?: boolean;
|
||||
contextMenu?: string;
|
||||
controls?: boolean;
|
||||
controlsList?: string;
|
||||
coords?: string;
|
||||
crossOrigin?: string;
|
||||
data?: string;
|
||||
dateTime?: string;
|
||||
default?: boolean;
|
||||
defer?: boolean;
|
||||
dir?: string;
|
||||
disabled?: boolean;
|
||||
download?: any;
|
||||
draggable?: boolean;
|
||||
encType?: string;
|
||||
form?: string;
|
||||
formAction?: string;
|
||||
formEncType?: string;
|
||||
formMethod?: string;
|
||||
formNoValidate?: boolean;
|
||||
formTarget?: string;
|
||||
frameBorder?: number | string;
|
||||
headers?: string;
|
||||
height?: number | string;
|
||||
hidden?: boolean;
|
||||
high?: number;
|
||||
href?: string;
|
||||
hrefLang?: string;
|
||||
for?: string;
|
||||
httpEquiv?: string;
|
||||
icon?: string;
|
||||
id?: string;
|
||||
inputMode?: string;
|
||||
integrity?: string;
|
||||
is?: string;
|
||||
keyParams?: string;
|
||||
keyType?: string;
|
||||
kind?: string;
|
||||
label?: string;
|
||||
lang?: string;
|
||||
list?: string;
|
||||
loop?: boolean;
|
||||
low?: number;
|
||||
manifest?: string;
|
||||
marginHeight?: number;
|
||||
marginWidth?: number;
|
||||
max?: number | string;
|
||||
maxLength?: number;
|
||||
media?: string;
|
||||
mediaGroup?: string;
|
||||
method?: string;
|
||||
min?: number | string;
|
||||
minLength?: number;
|
||||
multiple?: boolean;
|
||||
muted?: boolean;
|
||||
name?: string;
|
||||
noValidate?: boolean;
|
||||
open?: boolean;
|
||||
optimum?: number;
|
||||
pattern?: string;
|
||||
placeholder?: string;
|
||||
playsInline?: boolean;
|
||||
poster?: string;
|
||||
preload?: string;
|
||||
radioGroup?: string;
|
||||
readOnly?: boolean;
|
||||
rel?: string;
|
||||
required?: boolean;
|
||||
role?: string;
|
||||
rows?: number;
|
||||
rowSpan?: number;
|
||||
sandbox?: string;
|
||||
scope?: string;
|
||||
scoped?: boolean;
|
||||
scrolling?: string;
|
||||
seamless?: boolean;
|
||||
selected?: boolean;
|
||||
shape?: string;
|
||||
size?: number;
|
||||
sizes?: string;
|
||||
slot?: string;
|
||||
span?: number;
|
||||
spellcheck?: boolean;
|
||||
src?: string;
|
||||
srcset?: string;
|
||||
srcDoc?: string;
|
||||
srcLang?: string;
|
||||
srcSet?: string;
|
||||
start?: number;
|
||||
step?: number | string;
|
||||
style?: any;
|
||||
summary?: string;
|
||||
tabIndex?: number;
|
||||
target?: string;
|
||||
title?: string;
|
||||
type?: string;
|
||||
useMap?: string;
|
||||
value?: string | string[] | number;
|
||||
width?: number | string;
|
||||
wmode?: string;
|
||||
wrap?: string;
|
||||
|
||||
// RDFa Attributes
|
||||
about?: string;
|
||||
datatype?: string;
|
||||
inlist?: any;
|
||||
prefix?: string;
|
||||
property?: string;
|
||||
resource?: string;
|
||||
typeof?: string;
|
||||
vocab?: string;
|
||||
}
|
||||
|
||||
interface IntrinsicElements {
|
||||
// HTML
|
||||
a: HTMLAttributes;
|
||||
abbr: HTMLAttributes;
|
||||
address: HTMLAttributes;
|
||||
area: HTMLAttributes;
|
||||
article: HTMLAttributes;
|
||||
aside: HTMLAttributes;
|
||||
audio: HTMLAttributes;
|
||||
b: HTMLAttributes;
|
||||
base: HTMLAttributes;
|
||||
bdi: HTMLAttributes;
|
||||
bdo: HTMLAttributes;
|
||||
big: HTMLAttributes;
|
||||
blockquote: HTMLAttributes;
|
||||
body: HTMLAttributes;
|
||||
br: HTMLAttributes;
|
||||
button: HTMLAttributes;
|
||||
canvas: HTMLAttributes;
|
||||
caption: HTMLAttributes;
|
||||
cite: HTMLAttributes;
|
||||
code: HTMLAttributes;
|
||||
col: HTMLAttributes;
|
||||
colgroup: HTMLAttributes;
|
||||
data: HTMLAttributes;
|
||||
datalist: HTMLAttributes;
|
||||
dd: HTMLAttributes;
|
||||
del: HTMLAttributes;
|
||||
details: HTMLAttributes;
|
||||
dfn: HTMLAttributes;
|
||||
dialog: HTMLAttributes;
|
||||
div: HTMLAttributes;
|
||||
dl: HTMLAttributes;
|
||||
dt: HTMLAttributes;
|
||||
em: HTMLAttributes;
|
||||
embed: HTMLAttributes;
|
||||
fieldset: HTMLAttributes;
|
||||
figcaption: HTMLAttributes;
|
||||
figure: HTMLAttributes;
|
||||
footer: HTMLAttributes;
|
||||
form: HTMLAttributes;
|
||||
h1: HTMLAttributes;
|
||||
h2: HTMLAttributes;
|
||||
h3: HTMLAttributes;
|
||||
h4: HTMLAttributes;
|
||||
h5: HTMLAttributes;
|
||||
h6: HTMLAttributes;
|
||||
head: HTMLAttributes;
|
||||
header: HTMLAttributes;
|
||||
hr: HTMLAttributes;
|
||||
html: HTMLAttributes;
|
||||
i: HTMLAttributes;
|
||||
iframe: HTMLAttributes;
|
||||
img: HTMLAttributes;
|
||||
input: HTMLAttributes;
|
||||
ins: HTMLAttributes;
|
||||
kbd: HTMLAttributes;
|
||||
keygen: HTMLAttributes;
|
||||
label: HTMLAttributes;
|
||||
legend: HTMLAttributes;
|
||||
li: HTMLAttributes;
|
||||
link: HTMLAttributes;
|
||||
main: HTMLAttributes;
|
||||
map: HTMLAttributes;
|
||||
mark: HTMLAttributes;
|
||||
menu: HTMLAttributes;
|
||||
menuitem: HTMLAttributes;
|
||||
meta: HTMLAttributes;
|
||||
meter: HTMLAttributes;
|
||||
nav: HTMLAttributes;
|
||||
noscript: HTMLAttributes;
|
||||
object: HTMLAttributes;
|
||||
ol: HTMLAttributes;
|
||||
optgroup: HTMLAttributes;
|
||||
option: HTMLAttributes;
|
||||
output: HTMLAttributes;
|
||||
p: HTMLAttributes;
|
||||
param: HTMLAttributes;
|
||||
picture: HTMLAttributes;
|
||||
pre: HTMLAttributes;
|
||||
progress: HTMLAttributes;
|
||||
q: HTMLAttributes;
|
||||
rp: HTMLAttributes;
|
||||
rt: HTMLAttributes;
|
||||
ruby: HTMLAttributes;
|
||||
s: HTMLAttributes;
|
||||
samp: HTMLAttributes;
|
||||
script: HTMLAttributes;
|
||||
section: HTMLAttributes;
|
||||
select: HTMLAttributes;
|
||||
slot: HTMLAttributes;
|
||||
small: HTMLAttributes;
|
||||
source: HTMLAttributes;
|
||||
span: HTMLAttributes;
|
||||
strong: HTMLAttributes;
|
||||
style: HTMLAttributes;
|
||||
sub: HTMLAttributes;
|
||||
summary: HTMLAttributes;
|
||||
sup: HTMLAttributes;
|
||||
table: HTMLAttributes;
|
||||
tbody: HTMLAttributes;
|
||||
td: HTMLAttributes;
|
||||
textarea: HTMLAttributes;
|
||||
tfoot: HTMLAttributes;
|
||||
th: HTMLAttributes;
|
||||
thead: HTMLAttributes;
|
||||
time: HTMLAttributes;
|
||||
title: HTMLAttributes;
|
||||
tr: HTMLAttributes;
|
||||
track: HTMLAttributes;
|
||||
u: HTMLAttributes;
|
||||
ul: HTMLAttributes;
|
||||
"var": HTMLAttributes;
|
||||
video: HTMLAttributes;
|
||||
wbr: HTMLAttributes;
|
||||
|
||||
//SVG
|
||||
svg: SVGAttributes;
|
||||
animate: SVGAttributes;
|
||||
circle: SVGAttributes;
|
||||
clipPath: SVGAttributes;
|
||||
defs: SVGAttributes;
|
||||
ellipse: SVGAttributes;
|
||||
feBlend: SVGAttributes;
|
||||
feColorMatrix: SVGAttributes;
|
||||
feComponentTransfer: SVGAttributes;
|
||||
feComposite: SVGAttributes;
|
||||
feConvolveMatrix: SVGAttributes;
|
||||
feDiffuseLighting: SVGAttributes;
|
||||
feDisplacementMap: SVGAttributes;
|
||||
feFlood: SVGAttributes;
|
||||
feGaussianBlur: SVGAttributes;
|
||||
feImage: SVGAttributes;
|
||||
feMerge: SVGAttributes;
|
||||
feMergeNode: SVGAttributes;
|
||||
feMorphology: SVGAttributes;
|
||||
feOffset: SVGAttributes;
|
||||
feSpecularLighting: SVGAttributes;
|
||||
feTile: SVGAttributes;
|
||||
feTurbulence: SVGAttributes;
|
||||
filter: SVGAttributes;
|
||||
foreignObject: SVGAttributes;
|
||||
g: SVGAttributes;
|
||||
image: SVGAttributes;
|
||||
line: SVGAttributes;
|
||||
linearGradient: SVGAttributes;
|
||||
marker: SVGAttributes;
|
||||
mask: SVGAttributes;
|
||||
path: SVGAttributes;
|
||||
pattern: SVGAttributes;
|
||||
polygon: SVGAttributes;
|
||||
polyline: SVGAttributes;
|
||||
radialGradient: SVGAttributes;
|
||||
rect: SVGAttributes;
|
||||
stop: SVGAttributes;
|
||||
symbol: SVGAttributes;
|
||||
text: SVGAttributes;
|
||||
tspan: SVGAttributes;
|
||||
use: SVGAttributes;
|
||||
[tagName: string]: any;
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,13 @@
|
|||
/* @flow */
|
||||
|
||||
import { createElement, cloneElement, Component, type Node } from 'react';
|
||||
|
||||
declare var h: createElement;
|
||||
|
||||
declare function render(vnode: Node, parent: Element, toReplace?: Element): Element;
|
||||
|
||||
export { h, createElement, cloneElement, Component, render };
|
||||
export default { h, createElement, cloneElement, Component, render };
|
||||
|
||||
declare export function rerender(): void;
|
||||
declare export var options: Object;
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,146 @@
|
|||
import { WeElement, define, render } from 'omi'
|
||||
import 'omi-router'
|
||||
|
||||
let currentPage = null
|
||||
let stackList = []
|
||||
|
||||
window.stackList = stackList
|
||||
define('o-router', class extends WeElement {
|
||||
|
||||
_firstTime = true
|
||||
|
||||
installed() {
|
||||
const root = document.querySelector('#app')
|
||||
let main
|
||||
this.props.routes.forEach(current => {
|
||||
route(current.path, (evt) => {
|
||||
current.componentLoader()
|
||||
.then(res => {
|
||||
const arr = current.path.replace(/pages/, 'page').split('/')
|
||||
const selector = current.path.replace(/\//g, '-')
|
||||
routeUpdate({ nodeName: arr[1] + '-' + arr[2], attributes: { className: selector } }, selector, evt.byNative, root)
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
})
|
||||
})
|
||||
if (current.isIndex) {
|
||||
main = current
|
||||
current.componentLoader()
|
||||
.then(res => {
|
||||
const arr = this.props.routes[0].path.replace(/pages/, 'page').split('/')
|
||||
const selector = main.path.replace(/\//g, '-')
|
||||
|
||||
this.vd = { nodeName: arr[1] + '-' + arr[2] }
|
||||
this.update()
|
||||
const ele = root.childNodes[root.childNodes.length - 1]
|
||||
stackList.push({ slt: selector, ele: ele, display: window.getComputedStyle(ele).display, scrollTop: 0 })
|
||||
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
route('*', (evt) => {
|
||||
main.componentLoader()
|
||||
.then(res => {
|
||||
const arr = main.path.replace(/pages/, 'page').split('/')
|
||||
const selector = main.path.replace(/\//g, '-')
|
||||
routeUpdate({ nodeName: arr[1] + '-' + arr[2] }, selector, evt.byNative, root)
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
if (this._firstTime) {
|
||||
this._firstTime = false
|
||||
return null
|
||||
} else {
|
||||
return this.vd
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
export function routeUpdate(vnode, selector, byNative, root) {
|
||||
root.childNodes.forEach(child => {
|
||||
if (child.style.display !== 'none') {
|
||||
child.style.display = 'none'
|
||||
child.onHide && child.onHide()
|
||||
child._component && child._component.onHide && child._component.onHide()
|
||||
}
|
||||
})
|
||||
const item = getElement(selector)
|
||||
if (byNative) {
|
||||
//浏览器后退
|
||||
if (item && item.ele) {
|
||||
const ele = item.ele
|
||||
ele.style.display = item.display
|
||||
ele.onShow && ele.onShow()
|
||||
ele._component && ele._component.onShow && ele._component.onShow()
|
||||
currentPage = ele
|
||||
document.documentElement.scrollTop = item.scrollTop
|
||||
document.body.scrollTop = item.scrollTop
|
||||
//set twice
|
||||
setTimeout(function () {
|
||||
document.documentElement.scrollTop = item.scrollTop
|
||||
document.body.scrollTop = item.scrollTop
|
||||
}, 0)
|
||||
} else {
|
||||
const node = render(vnode, root)
|
||||
node.onShow && node.onShow()
|
||||
node._component && node._component.onShow && node._component.onShow()
|
||||
currentPage = node
|
||||
document.documentElement.scrollTop = 0
|
||||
document.body.scrollTop = 0
|
||||
}
|
||||
} else {
|
||||
//前进
|
||||
if (item && item.ele) {
|
||||
item.ele.parentNode.removeChild(item.ele)
|
||||
remove(item)
|
||||
}
|
||||
const node = render(vnode, root)
|
||||
node.onShow && node.onShow()
|
||||
node._component && node._component.onShow && node._component.onShow()
|
||||
currentPage = node
|
||||
|
||||
const ele = root.childNodes[root.childNodes.length - 1]
|
||||
stackList.push({ slt: selector, ele: ele, display: window.getComputedStyle(ele).display, scrollTop: 0 })
|
||||
document.documentElement.scrollTop = 0
|
||||
document.body.scrollTop = 0
|
||||
}
|
||||
}
|
||||
|
||||
function getElement(slt) {
|
||||
for (let i = 0, length = stackList.length; i < length; i++) {
|
||||
if (stackList[i].slt === slt) {
|
||||
return stackList[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function remove(item) {
|
||||
for (let i = 0, length = stackList.length; i < length; i++) {
|
||||
if (stackList[i] === item) {
|
||||
stackList.splice(i, 1)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
window.onscroll = function () {
|
||||
const top = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
|
||||
for (let i = 0, length = stackList.length; i < length; i++) {
|
||||
if (stackList[i].ele === currentPage) {
|
||||
stackList[i].scrollTop = top
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
|
@ -61,6 +61,7 @@ define('page-index', class extends WeElement {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { hasUserInfo, canIUse, userInfo, motto } = this.data
|
||||
return (
|
||||
<view class="container">
|
||||
<view class="userinfo">
|
||||
|
|
|
@ -50,7 +50,7 @@ define('page-list', class extends WeElement {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { showLoading, films } = this.data
|
||||
const { showLoading, films, hasMore } = this.data
|
||||
|
||||
if (showLoading) {
|
||||
return (
|
||||
|
|
|
@ -1,142 +1,142 @@
|
|||
{
|
||||
"example.css": "static/css/example.2df5426b.css",
|
||||
"example.css.map": "static/css/example.2df5426b.css.map",
|
||||
"example.js": "static/js/example.b7972a87.js",
|
||||
"example.js.map": "static/js/example.b7972a87.js.map",
|
||||
"example.js": "static/js/example.2bdfc031.js",
|
||||
"example.js.map": "static/js/example.2bdfc031.js.map",
|
||||
"index.css": "static/css/index.2df5426b.css",
|
||||
"index.css.map": "static/css/index.2df5426b.css.map",
|
||||
"index.js": "static/js/index.ab2fa05e.js",
|
||||
"index.js.map": "static/js/index.ab2fa05e.js.map",
|
||||
"static/js/0.d0d17a50.chunk.js": "static/js/0.d0d17a50.chunk.js",
|
||||
"static/js/0.d0d17a50.chunk.js.map": "static/js/0.d0d17a50.chunk.js.map",
|
||||
"static/js/1.c5d4503e.chunk.js": "static/js/1.c5d4503e.chunk.js",
|
||||
"static/js/1.c5d4503e.chunk.js.map": "static/js/1.c5d4503e.chunk.js.map",
|
||||
"static/js/10.5e47c138.chunk.js": "static/js/10.5e47c138.chunk.js",
|
||||
"static/js/10.5e47c138.chunk.js.map": "static/js/10.5e47c138.chunk.js.map",
|
||||
"static/js/11.5a7901ba.chunk.js": "static/js/11.5a7901ba.chunk.js",
|
||||
"static/js/11.5a7901ba.chunk.js.map": "static/js/11.5a7901ba.chunk.js.map",
|
||||
"static/js/12.259d9f0e.chunk.js": "static/js/12.259d9f0e.chunk.js",
|
||||
"static/js/12.259d9f0e.chunk.js.map": "static/js/12.259d9f0e.chunk.js.map",
|
||||
"static/js/13.a85b186a.chunk.js": "static/js/13.a85b186a.chunk.js",
|
||||
"static/js/13.a85b186a.chunk.js.map": "static/js/13.a85b186a.chunk.js.map",
|
||||
"static/js/14.a06793bd.chunk.js": "static/js/14.a06793bd.chunk.js",
|
||||
"static/js/14.a06793bd.chunk.js.map": "static/js/14.a06793bd.chunk.js.map",
|
||||
"static/js/15.76347967.chunk.js": "static/js/15.76347967.chunk.js",
|
||||
"static/js/15.76347967.chunk.js.map": "static/js/15.76347967.chunk.js.map",
|
||||
"static/js/16.125ac98e.chunk.js": "static/js/16.125ac98e.chunk.js",
|
||||
"static/js/16.125ac98e.chunk.js.map": "static/js/16.125ac98e.chunk.js.map",
|
||||
"static/js/17.19d413fa.chunk.js": "static/js/17.19d413fa.chunk.js",
|
||||
"static/js/17.19d413fa.chunk.js.map": "static/js/17.19d413fa.chunk.js.map",
|
||||
"static/js/18.dfc4a6d0.chunk.js": "static/js/18.dfc4a6d0.chunk.js",
|
||||
"static/js/18.dfc4a6d0.chunk.js.map": "static/js/18.dfc4a6d0.chunk.js.map",
|
||||
"static/js/19.77318125.chunk.js": "static/js/19.77318125.chunk.js",
|
||||
"static/js/19.77318125.chunk.js.map": "static/js/19.77318125.chunk.js.map",
|
||||
"static/js/2.73d36413.chunk.js": "static/js/2.73d36413.chunk.js",
|
||||
"static/js/2.73d36413.chunk.js.map": "static/js/2.73d36413.chunk.js.map",
|
||||
"static/js/20.4ca2c910.chunk.js": "static/js/20.4ca2c910.chunk.js",
|
||||
"static/js/20.4ca2c910.chunk.js.map": "static/js/20.4ca2c910.chunk.js.map",
|
||||
"static/js/21.fc49c35d.chunk.js": "static/js/21.fc49c35d.chunk.js",
|
||||
"static/js/21.fc49c35d.chunk.js.map": "static/js/21.fc49c35d.chunk.js.map",
|
||||
"static/js/22.5a218d15.chunk.js": "static/js/22.5a218d15.chunk.js",
|
||||
"static/js/22.5a218d15.chunk.js.map": "static/js/22.5a218d15.chunk.js.map",
|
||||
"static/js/23.5e633b68.chunk.js": "static/js/23.5e633b68.chunk.js",
|
||||
"static/js/23.5e633b68.chunk.js.map": "static/js/23.5e633b68.chunk.js.map",
|
||||
"static/js/24.7183e629.chunk.js": "static/js/24.7183e629.chunk.js",
|
||||
"static/js/24.7183e629.chunk.js.map": "static/js/24.7183e629.chunk.js.map",
|
||||
"static/js/25.e95d7efe.chunk.js": "static/js/25.e95d7efe.chunk.js",
|
||||
"static/js/25.e95d7efe.chunk.js.map": "static/js/25.e95d7efe.chunk.js.map",
|
||||
"static/js/26.fddf4432.chunk.js": "static/js/26.fddf4432.chunk.js",
|
||||
"static/js/26.fddf4432.chunk.js.map": "static/js/26.fddf4432.chunk.js.map",
|
||||
"static/js/27.14bfb164.chunk.js": "static/js/27.14bfb164.chunk.js",
|
||||
"static/js/27.14bfb164.chunk.js.map": "static/js/27.14bfb164.chunk.js.map",
|
||||
"static/js/28.e7561def.chunk.js": "static/js/28.e7561def.chunk.js",
|
||||
"static/js/28.e7561def.chunk.js.map": "static/js/28.e7561def.chunk.js.map",
|
||||
"static/js/29.280e0c80.chunk.js": "static/js/29.280e0c80.chunk.js",
|
||||
"static/js/29.280e0c80.chunk.js.map": "static/js/29.280e0c80.chunk.js.map",
|
||||
"static/js/3.6c59990f.chunk.js": "static/js/3.6c59990f.chunk.js",
|
||||
"static/js/3.6c59990f.chunk.js.map": "static/js/3.6c59990f.chunk.js.map",
|
||||
"static/js/30.7a89898f.chunk.js": "static/js/30.7a89898f.chunk.js",
|
||||
"static/js/30.7a89898f.chunk.js.map": "static/js/30.7a89898f.chunk.js.map",
|
||||
"static/js/31.313ed05c.chunk.js": "static/js/31.313ed05c.chunk.js",
|
||||
"static/js/31.313ed05c.chunk.js.map": "static/js/31.313ed05c.chunk.js.map",
|
||||
"static/js/32.18969cb2.chunk.js": "static/js/32.18969cb2.chunk.js",
|
||||
"static/js/32.18969cb2.chunk.js.map": "static/js/32.18969cb2.chunk.js.map",
|
||||
"static/js/33.c17c0c22.chunk.js": "static/js/33.c17c0c22.chunk.js",
|
||||
"static/js/33.c17c0c22.chunk.js.map": "static/js/33.c17c0c22.chunk.js.map",
|
||||
"static/js/34.e0172e08.chunk.js": "static/js/34.e0172e08.chunk.js",
|
||||
"static/js/34.e0172e08.chunk.js.map": "static/js/34.e0172e08.chunk.js.map",
|
||||
"static/js/35.0f50e52c.chunk.js": "static/js/35.0f50e52c.chunk.js",
|
||||
"static/js/35.0f50e52c.chunk.js.map": "static/js/35.0f50e52c.chunk.js.map",
|
||||
"static/js/36.f63a8a53.chunk.js": "static/js/36.f63a8a53.chunk.js",
|
||||
"static/js/36.f63a8a53.chunk.js.map": "static/js/36.f63a8a53.chunk.js.map",
|
||||
"static/js/37.962dad62.chunk.js": "static/js/37.962dad62.chunk.js",
|
||||
"static/js/37.962dad62.chunk.js.map": "static/js/37.962dad62.chunk.js.map",
|
||||
"static/js/38.9aead5ce.chunk.js": "static/js/38.9aead5ce.chunk.js",
|
||||
"static/js/38.9aead5ce.chunk.js.map": "static/js/38.9aead5ce.chunk.js.map",
|
||||
"static/js/39.9d869d98.chunk.js": "static/js/39.9d869d98.chunk.js",
|
||||
"static/js/39.9d869d98.chunk.js.map": "static/js/39.9d869d98.chunk.js.map",
|
||||
"static/js/4.eb9e71e5.chunk.js": "static/js/4.eb9e71e5.chunk.js",
|
||||
"static/js/4.eb9e71e5.chunk.js.map": "static/js/4.eb9e71e5.chunk.js.map",
|
||||
"static/js/40.702d143b.chunk.js": "static/js/40.702d143b.chunk.js",
|
||||
"static/js/40.702d143b.chunk.js.map": "static/js/40.702d143b.chunk.js.map",
|
||||
"static/js/41.d12e910f.chunk.js": "static/js/41.d12e910f.chunk.js",
|
||||
"static/js/41.d12e910f.chunk.js.map": "static/js/41.d12e910f.chunk.js.map",
|
||||
"static/js/42.7ab9318a.chunk.js": "static/js/42.7ab9318a.chunk.js",
|
||||
"static/js/42.7ab9318a.chunk.js.map": "static/js/42.7ab9318a.chunk.js.map",
|
||||
"static/js/43.0fb54b0c.chunk.js": "static/js/43.0fb54b0c.chunk.js",
|
||||
"static/js/43.0fb54b0c.chunk.js.map": "static/js/43.0fb54b0c.chunk.js.map",
|
||||
"static/js/44.c0a337d9.chunk.js": "static/js/44.c0a337d9.chunk.js",
|
||||
"static/js/44.c0a337d9.chunk.js.map": "static/js/44.c0a337d9.chunk.js.map",
|
||||
"static/js/45.07bd62fb.chunk.js": "static/js/45.07bd62fb.chunk.js",
|
||||
"static/js/45.07bd62fb.chunk.js.map": "static/js/45.07bd62fb.chunk.js.map",
|
||||
"static/js/46.de5a1400.chunk.js": "static/js/46.de5a1400.chunk.js",
|
||||
"static/js/46.de5a1400.chunk.js.map": "static/js/46.de5a1400.chunk.js.map",
|
||||
"static/js/47.5e4c2156.chunk.js": "static/js/47.5e4c2156.chunk.js",
|
||||
"static/js/47.5e4c2156.chunk.js.map": "static/js/47.5e4c2156.chunk.js.map",
|
||||
"static/js/48.f308636c.chunk.js": "static/js/48.f308636c.chunk.js",
|
||||
"static/js/48.f308636c.chunk.js.map": "static/js/48.f308636c.chunk.js.map",
|
||||
"static/js/49.fc10a45e.chunk.js": "static/js/49.fc10a45e.chunk.js",
|
||||
"static/js/49.fc10a45e.chunk.js.map": "static/js/49.fc10a45e.chunk.js.map",
|
||||
"static/js/5.bf62e293.chunk.js": "static/js/5.bf62e293.chunk.js",
|
||||
"static/js/5.bf62e293.chunk.js.map": "static/js/5.bf62e293.chunk.js.map",
|
||||
"static/js/50.4c4da2e5.chunk.js": "static/js/50.4c4da2e5.chunk.js",
|
||||
"static/js/50.4c4da2e5.chunk.js.map": "static/js/50.4c4da2e5.chunk.js.map",
|
||||
"static/js/51.727f4191.chunk.js": "static/js/51.727f4191.chunk.js",
|
||||
"static/js/51.727f4191.chunk.js.map": "static/js/51.727f4191.chunk.js.map",
|
||||
"static/js/52.6fdf071d.chunk.js": "static/js/52.6fdf071d.chunk.js",
|
||||
"static/js/52.6fdf071d.chunk.js.map": "static/js/52.6fdf071d.chunk.js.map",
|
||||
"static/js/53.3ca16fbc.chunk.js": "static/js/53.3ca16fbc.chunk.js",
|
||||
"static/js/53.3ca16fbc.chunk.js.map": "static/js/53.3ca16fbc.chunk.js.map",
|
||||
"static/js/54.e1d19c05.chunk.js": "static/js/54.e1d19c05.chunk.js",
|
||||
"static/js/54.e1d19c05.chunk.js.map": "static/js/54.e1d19c05.chunk.js.map",
|
||||
"static/js/55.3559eaae.chunk.js": "static/js/55.3559eaae.chunk.js",
|
||||
"static/js/55.3559eaae.chunk.js.map": "static/js/55.3559eaae.chunk.js.map",
|
||||
"static/js/56.9faf861f.chunk.js": "static/js/56.9faf861f.chunk.js",
|
||||
"static/js/56.9faf861f.chunk.js.map": "static/js/56.9faf861f.chunk.js.map",
|
||||
"static/js/57.4a3349b3.chunk.js": "static/js/57.4a3349b3.chunk.js",
|
||||
"static/js/57.4a3349b3.chunk.js.map": "static/js/57.4a3349b3.chunk.js.map",
|
||||
"static/js/58.07a83ac7.chunk.js": "static/js/58.07a83ac7.chunk.js",
|
||||
"static/js/58.07a83ac7.chunk.js.map": "static/js/58.07a83ac7.chunk.js.map",
|
||||
"static/js/59.dfab187a.chunk.js": "static/js/59.dfab187a.chunk.js",
|
||||
"static/js/59.dfab187a.chunk.js.map": "static/js/59.dfab187a.chunk.js.map",
|
||||
"static/js/6.e6396e37.chunk.js": "static/js/6.e6396e37.chunk.js",
|
||||
"static/js/6.e6396e37.chunk.js.map": "static/js/6.e6396e37.chunk.js.map",
|
||||
"static/js/7.222caf59.chunk.js": "static/js/7.222caf59.chunk.js",
|
||||
"static/js/7.222caf59.chunk.js.map": "static/js/7.222caf59.chunk.js.map",
|
||||
"static/js/8.6e697d40.chunk.js": "static/js/8.6e697d40.chunk.js",
|
||||
"static/js/8.6e697d40.chunk.js.map": "static/js/8.6e697d40.chunk.js.map",
|
||||
"static/js/9.fa86f77b.chunk.js": "static/js/9.fa86f77b.chunk.js",
|
||||
"static/js/9.fa86f77b.chunk.js.map": "static/js/9.fa86f77b.chunk.js.map",
|
||||
"static/media/loading.svg": "static/media/loading.84a15aa0.svg",
|
||||
"static/media/omi-logo2019.svg": "static/media/omi-logo2019.923166c3.svg",
|
||||
"step.js": "static/js/step.b2898a0d.js",
|
||||
"step.js.map": "static/js/step.b2898a0d.js.map",
|
||||
"timeline.js": "static/js/timeline.e4a49c68.js",
|
||||
"timeline.js.map": "static/js/timeline.e4a49c68.js.map",
|
||||
"tree.js": "static/js/tree.fc80efae.js",
|
||||
"tree.js.map": "static/js/tree.fc80efae.js.map",
|
||||
"index.js": "static/js/index.71f47660.js",
|
||||
"index.js.map": "static/js/index.71f47660.js.map",
|
||||
"static/js/0.ee445997.chunk.js": "static/js/0.ee445997.chunk.js",
|
||||
"static/js/0.ee445997.chunk.js.map": "static/js/0.ee445997.chunk.js.map",
|
||||
"static/js/1.138c327f.chunk.js": "static/js/1.138c327f.chunk.js",
|
||||
"static/js/1.138c327f.chunk.js.map": "static/js/1.138c327f.chunk.js.map",
|
||||
"static/js/10.09fe0c43.chunk.js": "static/js/10.09fe0c43.chunk.js",
|
||||
"static/js/10.09fe0c43.chunk.js.map": "static/js/10.09fe0c43.chunk.js.map",
|
||||
"static/js/11.9d9a7cb8.chunk.js": "static/js/11.9d9a7cb8.chunk.js",
|
||||
"static/js/11.9d9a7cb8.chunk.js.map": "static/js/11.9d9a7cb8.chunk.js.map",
|
||||
"static/js/12.7fcd6d48.chunk.js": "static/js/12.7fcd6d48.chunk.js",
|
||||
"static/js/12.7fcd6d48.chunk.js.map": "static/js/12.7fcd6d48.chunk.js.map",
|
||||
"static/js/13.e822e9e7.chunk.js": "static/js/13.e822e9e7.chunk.js",
|
||||
"static/js/13.e822e9e7.chunk.js.map": "static/js/13.e822e9e7.chunk.js.map",
|
||||
"static/js/14.8a3f05bd.chunk.js": "static/js/14.8a3f05bd.chunk.js",
|
||||
"static/js/14.8a3f05bd.chunk.js.map": "static/js/14.8a3f05bd.chunk.js.map",
|
||||
"static/js/15.2d9b0995.chunk.js": "static/js/15.2d9b0995.chunk.js",
|
||||
"static/js/15.2d9b0995.chunk.js.map": "static/js/15.2d9b0995.chunk.js.map",
|
||||
"static/js/16.6839e27a.chunk.js": "static/js/16.6839e27a.chunk.js",
|
||||
"static/js/16.6839e27a.chunk.js.map": "static/js/16.6839e27a.chunk.js.map",
|
||||
"static/js/17.49ea9d72.chunk.js": "static/js/17.49ea9d72.chunk.js",
|
||||
"static/js/17.49ea9d72.chunk.js.map": "static/js/17.49ea9d72.chunk.js.map",
|
||||
"static/js/18.7254d5e3.chunk.js": "static/js/18.7254d5e3.chunk.js",
|
||||
"static/js/18.7254d5e3.chunk.js.map": "static/js/18.7254d5e3.chunk.js.map",
|
||||
"static/js/19.6ea4e88d.chunk.js": "static/js/19.6ea4e88d.chunk.js",
|
||||
"static/js/19.6ea4e88d.chunk.js.map": "static/js/19.6ea4e88d.chunk.js.map",
|
||||
"static/js/2.54a621d5.chunk.js": "static/js/2.54a621d5.chunk.js",
|
||||
"static/js/2.54a621d5.chunk.js.map": "static/js/2.54a621d5.chunk.js.map",
|
||||
"static/js/20.b2a3f2da.chunk.js": "static/js/20.b2a3f2da.chunk.js",
|
||||
"static/js/20.b2a3f2da.chunk.js.map": "static/js/20.b2a3f2da.chunk.js.map",
|
||||
"static/js/21.8cc1af64.chunk.js": "static/js/21.8cc1af64.chunk.js",
|
||||
"static/js/21.8cc1af64.chunk.js.map": "static/js/21.8cc1af64.chunk.js.map",
|
||||
"static/js/22.4e77d459.chunk.js": "static/js/22.4e77d459.chunk.js",
|
||||
"static/js/22.4e77d459.chunk.js.map": "static/js/22.4e77d459.chunk.js.map",
|
||||
"static/js/23.ba2f2857.chunk.js": "static/js/23.ba2f2857.chunk.js",
|
||||
"static/js/23.ba2f2857.chunk.js.map": "static/js/23.ba2f2857.chunk.js.map",
|
||||
"static/js/24.73fb5abf.chunk.js": "static/js/24.73fb5abf.chunk.js",
|
||||
"static/js/24.73fb5abf.chunk.js.map": "static/js/24.73fb5abf.chunk.js.map",
|
||||
"static/js/25.45f049f5.chunk.js": "static/js/25.45f049f5.chunk.js",
|
||||
"static/js/25.45f049f5.chunk.js.map": "static/js/25.45f049f5.chunk.js.map",
|
||||
"static/js/26.8183f42e.chunk.js": "static/js/26.8183f42e.chunk.js",
|
||||
"static/js/26.8183f42e.chunk.js.map": "static/js/26.8183f42e.chunk.js.map",
|
||||
"static/js/27.3b6b2464.chunk.js": "static/js/27.3b6b2464.chunk.js",
|
||||
"static/js/27.3b6b2464.chunk.js.map": "static/js/27.3b6b2464.chunk.js.map",
|
||||
"static/js/28.d520d75d.chunk.js": "static/js/28.d520d75d.chunk.js",
|
||||
"static/js/28.d520d75d.chunk.js.map": "static/js/28.d520d75d.chunk.js.map",
|
||||
"static/js/29.ac398ebf.chunk.js": "static/js/29.ac398ebf.chunk.js",
|
||||
"static/js/29.ac398ebf.chunk.js.map": "static/js/29.ac398ebf.chunk.js.map",
|
||||
"static/js/3.dc2ae4a9.chunk.js": "static/js/3.dc2ae4a9.chunk.js",
|
||||
"static/js/3.dc2ae4a9.chunk.js.map": "static/js/3.dc2ae4a9.chunk.js.map",
|
||||
"static/js/30.861c1dad.chunk.js": "static/js/30.861c1dad.chunk.js",
|
||||
"static/js/30.861c1dad.chunk.js.map": "static/js/30.861c1dad.chunk.js.map",
|
||||
"static/js/31.8d260904.chunk.js": "static/js/31.8d260904.chunk.js",
|
||||
"static/js/31.8d260904.chunk.js.map": "static/js/31.8d260904.chunk.js.map",
|
||||
"static/js/32.912682a0.chunk.js": "static/js/32.912682a0.chunk.js",
|
||||
"static/js/32.912682a0.chunk.js.map": "static/js/32.912682a0.chunk.js.map",
|
||||
"static/js/33.59e39137.chunk.js": "static/js/33.59e39137.chunk.js",
|
||||
"static/js/33.59e39137.chunk.js.map": "static/js/33.59e39137.chunk.js.map",
|
||||
"static/js/34.72140186.chunk.js": "static/js/34.72140186.chunk.js",
|
||||
"static/js/34.72140186.chunk.js.map": "static/js/34.72140186.chunk.js.map",
|
||||
"static/js/35.8f9af177.chunk.js": "static/js/35.8f9af177.chunk.js",
|
||||
"static/js/35.8f9af177.chunk.js.map": "static/js/35.8f9af177.chunk.js.map",
|
||||
"static/js/36.a9c51e39.chunk.js": "static/js/36.a9c51e39.chunk.js",
|
||||
"static/js/36.a9c51e39.chunk.js.map": "static/js/36.a9c51e39.chunk.js.map",
|
||||
"static/js/37.51b36019.chunk.js": "static/js/37.51b36019.chunk.js",
|
||||
"static/js/37.51b36019.chunk.js.map": "static/js/37.51b36019.chunk.js.map",
|
||||
"static/js/38.1122dc82.chunk.js": "static/js/38.1122dc82.chunk.js",
|
||||
"static/js/38.1122dc82.chunk.js.map": "static/js/38.1122dc82.chunk.js.map",
|
||||
"static/js/39.5b4ee798.chunk.js": "static/js/39.5b4ee798.chunk.js",
|
||||
"static/js/39.5b4ee798.chunk.js.map": "static/js/39.5b4ee798.chunk.js.map",
|
||||
"static/js/4.c9b2b7de.chunk.js": "static/js/4.c9b2b7de.chunk.js",
|
||||
"static/js/4.c9b2b7de.chunk.js.map": "static/js/4.c9b2b7de.chunk.js.map",
|
||||
"static/js/40.24372fcf.chunk.js": "static/js/40.24372fcf.chunk.js",
|
||||
"static/js/40.24372fcf.chunk.js.map": "static/js/40.24372fcf.chunk.js.map",
|
||||
"static/js/41.5e2aa017.chunk.js": "static/js/41.5e2aa017.chunk.js",
|
||||
"static/js/41.5e2aa017.chunk.js.map": "static/js/41.5e2aa017.chunk.js.map",
|
||||
"static/js/42.31ea836e.chunk.js": "static/js/42.31ea836e.chunk.js",
|
||||
"static/js/42.31ea836e.chunk.js.map": "static/js/42.31ea836e.chunk.js.map",
|
||||
"static/js/43.cb4fa11a.chunk.js": "static/js/43.cb4fa11a.chunk.js",
|
||||
"static/js/43.cb4fa11a.chunk.js.map": "static/js/43.cb4fa11a.chunk.js.map",
|
||||
"static/js/44.42ae96ca.chunk.js": "static/js/44.42ae96ca.chunk.js",
|
||||
"static/js/44.42ae96ca.chunk.js.map": "static/js/44.42ae96ca.chunk.js.map",
|
||||
"static/js/45.62321b94.chunk.js": "static/js/45.62321b94.chunk.js",
|
||||
"static/js/45.62321b94.chunk.js.map": "static/js/45.62321b94.chunk.js.map",
|
||||
"static/js/46.a2744b59.chunk.js": "static/js/46.a2744b59.chunk.js",
|
||||
"static/js/46.a2744b59.chunk.js.map": "static/js/46.a2744b59.chunk.js.map",
|
||||
"static/js/47.2d48b6bd.chunk.js": "static/js/47.2d48b6bd.chunk.js",
|
||||
"static/js/47.2d48b6bd.chunk.js.map": "static/js/47.2d48b6bd.chunk.js.map",
|
||||
"static/js/48.93e735f8.chunk.js": "static/js/48.93e735f8.chunk.js",
|
||||
"static/js/48.93e735f8.chunk.js.map": "static/js/48.93e735f8.chunk.js.map",
|
||||
"static/js/49.fe9abf15.chunk.js": "static/js/49.fe9abf15.chunk.js",
|
||||
"static/js/49.fe9abf15.chunk.js.map": "static/js/49.fe9abf15.chunk.js.map",
|
||||
"static/js/5.c5babeaf.chunk.js": "static/js/5.c5babeaf.chunk.js",
|
||||
"static/js/5.c5babeaf.chunk.js.map": "static/js/5.c5babeaf.chunk.js.map",
|
||||
"static/js/50.7d793834.chunk.js": "static/js/50.7d793834.chunk.js",
|
||||
"static/js/50.7d793834.chunk.js.map": "static/js/50.7d793834.chunk.js.map",
|
||||
"static/js/51.28163cd5.chunk.js": "static/js/51.28163cd5.chunk.js",
|
||||
"static/js/51.28163cd5.chunk.js.map": "static/js/51.28163cd5.chunk.js.map",
|
||||
"static/js/52.32c11ca8.chunk.js": "static/js/52.32c11ca8.chunk.js",
|
||||
"static/js/52.32c11ca8.chunk.js.map": "static/js/52.32c11ca8.chunk.js.map",
|
||||
"static/js/53.8a95fd67.chunk.js": "static/js/53.8a95fd67.chunk.js",
|
||||
"static/js/53.8a95fd67.chunk.js.map": "static/js/53.8a95fd67.chunk.js.map",
|
||||
"static/js/54.a1bac6c9.chunk.js": "static/js/54.a1bac6c9.chunk.js",
|
||||
"static/js/54.a1bac6c9.chunk.js.map": "static/js/54.a1bac6c9.chunk.js.map",
|
||||
"static/js/55.22bc956c.chunk.js": "static/js/55.22bc956c.chunk.js",
|
||||
"static/js/55.22bc956c.chunk.js.map": "static/js/55.22bc956c.chunk.js.map",
|
||||
"static/js/56.ad84ef57.chunk.js": "static/js/56.ad84ef57.chunk.js",
|
||||
"static/js/56.ad84ef57.chunk.js.map": "static/js/56.ad84ef57.chunk.js.map",
|
||||
"static/js/57.80db4f6f.chunk.js": "static/js/57.80db4f6f.chunk.js",
|
||||
"static/js/57.80db4f6f.chunk.js.map": "static/js/57.80db4f6f.chunk.js.map",
|
||||
"static/js/58.59991c5b.chunk.js": "static/js/58.59991c5b.chunk.js",
|
||||
"static/js/58.59991c5b.chunk.js.map": "static/js/58.59991c5b.chunk.js.map",
|
||||
"static/js/59.24a90bc1.chunk.js": "static/js/59.24a90bc1.chunk.js",
|
||||
"static/js/59.24a90bc1.chunk.js.map": "static/js/59.24a90bc1.chunk.js.map",
|
||||
"static/js/6.16dcd58d.chunk.js": "static/js/6.16dcd58d.chunk.js",
|
||||
"static/js/6.16dcd58d.chunk.js.map": "static/js/6.16dcd58d.chunk.js.map",
|
||||
"static/js/7.6e12209d.chunk.js": "static/js/7.6e12209d.chunk.js",
|
||||
"static/js/7.6e12209d.chunk.js.map": "static/js/7.6e12209d.chunk.js.map",
|
||||
"static/js/8.7aa95294.chunk.js": "static/js/8.7aa95294.chunk.js",
|
||||
"static/js/8.7aa95294.chunk.js.map": "static/js/8.7aa95294.chunk.js.map",
|
||||
"static/js/9.d1d70a00.chunk.js": "static/js/9.d1d70a00.chunk.js",
|
||||
"static/js/9.d1d70a00.chunk.js.map": "static/js/9.d1d70a00.chunk.js.map",
|
||||
"static\\media\\loading.svg": "static/media/loading.84a15aa0.svg",
|
||||
"static\\media\\omi-logo2019.svg": "static/media/omi-logo2019.923166c3.svg",
|
||||
"step.js": "static/js/step.1dd2ca9b.js",
|
||||
"step.js.map": "static/js/step.1dd2ca9b.js.map",
|
||||
"timeline.js": "static/js/timeline.c61f8c12.js",
|
||||
"timeline.js.map": "static/js/timeline.c61f8c12.js.map",
|
||||
"tree.js": "static/js/tree.d7ca8997.js",
|
||||
"tree.js.map": "static/js/tree.d7ca8997.js.map",
|
||||
"zh-cn.css": "static/css/zh-cn.2df5426b.css",
|
||||
"zh-cn.css.map": "static/css/zh-cn.2df5426b.css.map",
|
||||
"zh-cn.js": "static/js/zh-cn.fe1cc36a.js",
|
||||
"zh-cn.js.map": "static/js/zh-cn.fe1cc36a.js.map"
|
||||
"zh-cn.js": "static/js/zh-cn.4066aa5e.js",
|
||||
"zh-cn.js.map": "static/js/zh-cn.4066aa5e.js.map"
|
||||
}
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="shortcut icon" href="./favicon.ico"><link rel="stylesheet" href="./highlight/prism.css"><style>*{-webkit-tap-highlight-color:rgba(255,255,255,0);-moz-user-focus:none}</style><title>Omiu - Simple Omi UI</title><link href="./static/css/example.2df5426b.css" rel="stylesheet"></head><body><script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script><script src="./highlight/prism.js"></script><script src="./js/remarkable.min.js"></script><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="./static/js/example.b7972a87.js"></script></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="shortcut icon" href="./favicon.ico"><link rel="stylesheet" href="./highlight/prism.css"><style>*{-webkit-tap-highlight-color:rgba(255,255,255,0);-moz-user-focus:none}</style><title>Omiu - Simple Omi UI</title><link href="./static/css/example.2df5426b.css" rel="stylesheet"></head><body><script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script><script src="./highlight/prism.js"></script><script src="./js/remarkable.min.js"></script><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="./static/js/example.2bdfc031.js"></script></body></html>
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="shortcut icon" href="./favicon.ico"><link rel="stylesheet" href="./highlight/prism.css"><style>*{-webkit-tap-highlight-color:rgba(255,255,255,0);-moz-user-focus:none}</style><title>Omiu - Simple Omi UI</title><link href="./static/css/index.2df5426b.css" rel="stylesheet"></head><body><script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script><script src="./highlight/prism.js"></script><script src="./js/remarkable.min.js"></script><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="./static/js/index.ab2fa05e.js"></script></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="shortcut icon" href="./favicon.ico"><link rel="stylesheet" href="./highlight/prism.css"><style>*{-webkit-tap-highlight-color:rgba(255,255,255,0);-moz-user-focus:none}</style><title>Omiu - Simple Omi UI</title><link href="./static/css/index.2df5426b.css" rel="stylesheet"></head><body><script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script><script src="./highlight/prism.js"></script><script src="./js/remarkable.min.js"></script><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="./static/js/index.71f47660.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
|
@ -1,2 +1,2 @@
|
|||
webpackJsonp([0],{109:function(n,o){n.exports="## Toast \n\n\u7b80\u5355\u7684\u63d0\u9192\u901a\u77e5\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-toast type='success' show={true}>\u652f\u4ed8\u6210\u529f</o-toast>\n<o-toast type='loading' show={false}>\u52a0\u8f7d\u4e2d</o-toast>\n```\n\n\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u7684\u65b9\u5f0f\uff1a\n\n```js\nimport toast from 'omiu/toast'\n\n//\u663e\u793a\ntoast.showLoading()\n//\u9690\u85cf\ntoast.hideLoading()\n//\u652f\u6301\u81ea\u5b9a\u4e49\u6587\u5b57\ntoast.showLoading('\u8bf7\u6c42\u4e2d...')\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| show | bool | false ||\n| type | string | -- |Options: loading, success|\n"}});
|
||||
//# sourceMappingURL=0.d0d17a50.chunk.js.map
|
||||
webpackJsonp([0],{111:function(n,o){n.exports="## Toast \n\n\u7b80\u5355\u7684\u63d0\u9192\u901a\u77e5\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-toast type='success' show={true}>\u652f\u4ed8\u6210\u529f</o-toast>\n<o-toast type='loading' show={false}>\u52a0\u8f7d\u4e2d</o-toast>\n```\n\n\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u7684\u65b9\u5f0f\uff1a\n\n```js\nimport toast from 'omiu/toast'\n\n//\u663e\u793a\ntoast.showLoading()\n//\u9690\u85cf\ntoast.hideLoading()\n//\u652f\u6301\u81ea\u5b9a\u4e49\u6587\u5b57\ntoast.showLoading('\u8bf7\u6c42\u4e2d...')\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| show | bool | false ||\n| type | string | -- |Options: loading, success|\n"}});
|
||||
//# sourceMappingURL=0.ee445997.chunk.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["../static/js/0.d0d17a50.chunk.js","docs/zh-cn/toast.md"],"names":["webpackJsonp","109","module","exports"],"mappings":"AAAAA,cAAc,IAERC,IACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/0.d0d17a50.chunk.js","sourcesContent":["webpackJsonp([0],{\n\n/***/ 109:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Toast \\n\\n简单的提醒通知。\\n\\n## 使用\\n\\n```js\\n<o-toast type='success' show={true}>支付成功</o-toast>\\n<o-toast type='loading' show={false}>加载中</o-toast>\\n```\\n\\n你也可以使用命令的方式:\\n\\n```js\\nimport toast from 'omiu/toast'\\n\\n//显示\\ntoast.showLoading()\\n//隐藏\\ntoast.hideLoading()\\n//支持自定义文字\\ntoast.showLoading('请求中...')\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | false ||\\n| type | string | -- |Options: loading, success|\\n\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/0.d0d17a50.chunk.js","module.exports = \"## Toast \\n\\n简单的提醒通知。\\n\\n## 使用\\n\\n```js\\n<o-toast type='success' show={true}>支付成功</o-toast>\\n<o-toast type='loading' show={false}>加载中</o-toast>\\n```\\n\\n你也可以使用命令的方式:\\n\\n```js\\nimport toast from 'omiu/toast'\\n\\n//显示\\ntoast.showLoading()\\n//隐藏\\ntoast.hideLoading()\\n//支持自定义文字\\ntoast.showLoading('请求中...')\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | false ||\\n| type | string | -- |Options: loading, success|\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/toast.md\n// module id = 109\n// module chunks = 0"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../static/js/0.ee445997.chunk.js","docs/zh-cn/toast.md"],"names":["webpackJsonp","111","module","exports"],"mappings":"AAAAA,cAAc,IAERC,IACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/0.ee445997.chunk.js","sourcesContent":["webpackJsonp([0],{\n\n/***/ 111:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Toast \\n\\n简单的提醒通知。\\n\\n## 使用\\n\\n```js\\n<o-toast type='success' show={true}>支付成功</o-toast>\\n<o-toast type='loading' show={false}>加载中</o-toast>\\n```\\n\\n你也可以使用命令的方式:\\n\\n```js\\nimport toast from 'omiu/toast'\\n\\n//显示\\ntoast.showLoading()\\n//隐藏\\ntoast.hideLoading()\\n//支持自定义文字\\ntoast.showLoading('请求中...')\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | false ||\\n| type | string | -- |Options: loading, success|\\n\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/0.ee445997.chunk.js","module.exports = \"## Toast \\n\\n简单的提醒通知。\\n\\n## 使用\\n\\n```js\\n<o-toast type='success' show={true}>支付成功</o-toast>\\n<o-toast type='loading' show={false}>加载中</o-toast>\\n```\\n\\n你也可以使用命令的方式:\\n\\n```js\\nimport toast from 'omiu/toast'\\n\\n//显示\\ntoast.showLoading()\\n//隐藏\\ntoast.hideLoading()\\n//支持自定义文字\\ntoast.showLoading('请求中...')\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | false ||\\n| type | string | -- |Options: loading, success|\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/toast.md\n// module id = 111\n// module chunks = 0"],"sourceRoot":""}
|
|
@ -1,2 +1,2 @@
|
|||
webpackJsonp([1],{108:function(s,m){s.exports="## Timeline \n\n\u65f6\u95f4\u7ebf.\n\n## \u4f7f\u7528\n\n```js\n<o-timeline data={[\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'create project', msgD: '[sub msg]' },\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'delete readme', msgD: '[sub msg]' },\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'update readme', msgD: '[sub msg]' },\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'others', msgD: '[sub others]' }\n]} />\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------|\n| data | json array| -- | \u6570\u7ec4\u9879\u7684\u7ed3\u6784: <br> { <br>\u3000msgA: '2018.11.11',<br>\u3000msgB: '15:22:09', <br>\u3000msgC: 'create project',<br>\u3000msgD: '[sub msg]' <br>} |\u3000"}});
|
||||
//# sourceMappingURL=1.c5d4503e.chunk.js.map
|
||||
webpackJsonp([1],{110:function(s,m){s.exports="## Timeline \n\n\u65f6\u95f4\u7ebf.\n\n## \u4f7f\u7528\n\n```js\n<o-timeline data={[\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'create project', msgD: '[sub msg]' },\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'delete readme', msgD: '[sub msg]' },\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'update readme', msgD: '[sub msg]' },\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'others', msgD: '[sub others]' }\n]} />\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------|\n| data | json array| -- | \u6570\u7ec4\u9879\u7684\u7ed3\u6784: <br> { <br>\u3000msgA: '2018.11.11',<br>\u3000msgB: '15:22:09', <br>\u3000msgC: 'create project',<br>\u3000msgD: '[sub msg]' <br>} |\u3000"}});
|
||||
//# sourceMappingURL=1.138c327f.chunk.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["../static/js/1.c5d4503e.chunk.js","docs/zh-cn/timeline.md"],"names":["webpackJsonp","108","module","exports"],"mappings":"AAAAA,cAAc,IAERC,IACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/1.c5d4503e.chunk.js","sourcesContent":["webpackJsonp([1],{\n\n/***/ 108:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Timeline \\n\\n时间线.\\n\\n## 使用\\n\\n```js\\n<o-timeline data={[\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'create project', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'delete readme', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'update readme', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'others', msgD: '[sub others]' }\\n]} />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------|\\n| data | json array| -- | 数组项的结构: <br> { <br> msgA: '2018.11.11',<br> msgB: '15:22:09', <br> msgC: 'create project',<br> msgD: '[sub msg]' <br>} | \"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/1.c5d4503e.chunk.js","module.exports = \"## Timeline \\n\\n时间线.\\n\\n## 使用\\n\\n```js\\n<o-timeline data={[\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'create project', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'delete readme', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'update readme', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'others', msgD: '[sub others]' }\\n]} />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------|\\n| data | json array| -- | 数组项的结构: <br> { <br> msgA: '2018.11.11',<br> msgB: '15:22:09', <br> msgC: 'create project',<br> msgD: '[sub msg]' <br>} | \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/timeline.md\n// module id = 108\n// module chunks = 1"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../static/js/1.138c327f.chunk.js","docs/zh-cn/timeline.md"],"names":["webpackJsonp","110","module","exports"],"mappings":"AAAAA,cAAc,IAERC,IACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/1.138c327f.chunk.js","sourcesContent":["webpackJsonp([1],{\n\n/***/ 110:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Timeline \\n\\n时间线.\\n\\n## 使用\\n\\n```js\\n<o-timeline data={[\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'create project', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'delete readme', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'update readme', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'others', msgD: '[sub others]' }\\n]} />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------|\\n| data | json array| -- | 数组项的结构: <br> { <br> msgA: '2018.11.11',<br> msgB: '15:22:09', <br> msgC: 'create project',<br> msgD: '[sub msg]' <br>} | \"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/1.138c327f.chunk.js","module.exports = \"## Timeline \\n\\n时间线.\\n\\n## 使用\\n\\n```js\\n<o-timeline data={[\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'create project', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'delete readme', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'update readme', msgD: '[sub msg]' },\\n { msgA: '2018.11.11', msgB: '15:22:09', msgC: 'others', msgD: '[sub others]' }\\n]} />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------|\\n| data | json array| -- | 数组项的结构: <br> { <br> msgA: '2018.11.11',<br> msgB: '15:22:09', <br> msgC: 'create project',<br> msgD: '[sub msg]' <br>} | \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/timeline.md\n// module id = 110\n// module chunks = 1"],"sourceRoot":""}
|
|
@ -0,0 +1,2 @@
|
|||
webpackJsonp([10],{101:function(n,o){n.exports='## Progress \n\n\u5c55\u793a\u4e00\u4e2a\u4efb\u52a1\u7684\u8fdb\u5ea6.\n\n## \u4f7f\u7528\n\n```js\n<o-progress bgColor="#ccc" innerColor="#07C160" value={50} />\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| value | number| 0 | \u6700\u5c0f\u662f0\uff0c\u6700\u5927\u662f100 |\n| bgColor | string| #CCCCCC | \u80cc\u666f\u8272 |\n| innerColor | string| #07C160 | \u8fdb\u5ea6\u6761\u7684\u989c\u8272 |'}});
|
||||
//# sourceMappingURL=10.09fe0c43.chunk.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../static/js/10.09fe0c43.chunk.js","docs/zh-cn/progress.md"],"names":["webpackJsonp","101","module","exports"],"mappings":"AAAAA,cAAc,KAERC,IACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/10.09fe0c43.chunk.js","sourcesContent":["webpackJsonp([10],{\n\n/***/ 101:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Progress \\n\\n展示一个任务的进度.\\n\\n## 使用\\n\\n```js\\n<o-progress bgColor=\\\"#ccc\\\" innerColor=\\\"#07C160\\\" value={50} />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| value | number| 0 | 最小是0,最大是100 |\\n| bgColor | string| #CCCCCC | 背景色 |\\n| innerColor | string| #07C160 | 进度条的颜色 |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/10.09fe0c43.chunk.js","module.exports = \"## Progress \\n\\n展示一个任务的进度.\\n\\n## 使用\\n\\n```js\\n<o-progress bgColor=\\\"#ccc\\\" innerColor=\\\"#07C160\\\" value={50} />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| value | number| 0 | 最小是0,最大是100 |\\n| bgColor | string| #CCCCCC | 背景色 |\\n| innerColor | string| #07C160 | 进度条的颜色 |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/progress.md\n// module id = 101\n// module chunks = 10"],"sourceRoot":""}
|
|
@ -1,2 +0,0 @@
|
|||
webpackJsonp([10],{99:function(n,o){n.exports='## Progress \n\n\u5c55\u793a\u4e00\u4e2a\u4efb\u52a1\u7684\u8fdb\u5ea6.\n\n## \u4f7f\u7528\n\n```js\n<o-progress bgColor="#ccc" innerColor="#07C160" value={50} />\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| value | number| 0 | \u6700\u5c0f\u662f0\uff0c\u6700\u5927\u662f100 |\n| bgColor | string| #CCCCCC | \u80cc\u666f\u8272 |\n| innerColor | string| #07C160 | \u8fdb\u5ea6\u6761\u7684\u989c\u8272 |'}});
|
||||
//# sourceMappingURL=10.5e47c138.chunk.js.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"sources":["../static/js/10.5e47c138.chunk.js","docs/zh-cn/progress.md"],"names":["webpackJsonp","99","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/10.5e47c138.chunk.js","sourcesContent":["webpackJsonp([10],{\n\n/***/ 99:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Progress \\n\\n展示一个任务的进度.\\n\\n## 使用\\n\\n```js\\n<o-progress bgColor=\\\"#ccc\\\" innerColor=\\\"#07C160\\\" value={50} />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| value | number| 0 | 最小是0,最大是100 |\\n| bgColor | string| #CCCCCC | 背景色 |\\n| innerColor | string| #07C160 | 进度条的颜色 |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/10.5e47c138.chunk.js","module.exports = \"## Progress \\n\\n展示一个任务的进度.\\n\\n## 使用\\n\\n```js\\n<o-progress bgColor=\\\"#ccc\\\" innerColor=\\\"#07C160\\\" value={50} />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| value | number| 0 | 最小是0,最大是100 |\\n| bgColor | string| #CCCCCC | 背景色 |\\n| innerColor | string| #07C160 | 进度条的颜色 |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/progress.md\n// module id = 99\n// module chunks = 10"],"sourceRoot":""}
|
|
@ -1,2 +0,0 @@
|
|||
webpackJsonp([11],{98:function(n,o){n.exports="## Popup \n\n\u5f39\u51fa\u5c42\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-popup\n onClose={this.closePopup}\n onConfirm={this.onConfirm}\n show={this.popupShow} \n title='My Title'\n cancelText='cancel'\n confirmText='confirm'\n>\n <div>I am content</div>\n <div>I am content</div>\n <div>I am content</div>\n <div>I am content</div>\n</o-popup>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| show | bool | -- | |\n| title | string | -- | |\n| width | number | -- | |\n| cancelText | string | -- | |\n| confirmText | string | -- | |\n| onClose |function | -- | |\n| onConfirm | function | -- | |\n| children | vdom json array | -- | |"}});
|
||||
//# sourceMappingURL=11.5a7901ba.chunk.js.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"sources":["../static/js/11.5a7901ba.chunk.js","docs/zh-cn/popup.md"],"names":["webpackJsonp","98","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/11.5a7901ba.chunk.js","sourcesContent":["webpackJsonp([11],{\n\n/***/ 98:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Popup \\n\\n弹出层。\\n\\n## 使用\\n\\n```js\\n<o-popup\\n onClose={this.closePopup}\\n onConfirm={this.onConfirm}\\n show={this.popupShow} \\n title='My Title'\\n cancelText='cancel'\\n confirmText='confirm'\\n>\\n <div>I am content</div>\\n <div>I am content</div>\\n <div>I am content</div>\\n <div>I am content</div>\\n</o-popup>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | -- | |\\n| title | string | -- | |\\n| width | number | -- | |\\n| cancelText | string | -- | |\\n| confirmText | string | -- | |\\n| onClose |function | -- | |\\n| onConfirm | function | -- | |\\n| children | vdom json array | -- | |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/11.5a7901ba.chunk.js","module.exports = \"## Popup \\n\\n弹出层。\\n\\n## 使用\\n\\n```js\\n<o-popup\\n onClose={this.closePopup}\\n onConfirm={this.onConfirm}\\n show={this.popupShow} \\n title='My Title'\\n cancelText='cancel'\\n confirmText='confirm'\\n>\\n <div>I am content</div>\\n <div>I am content</div>\\n <div>I am content</div>\\n <div>I am content</div>\\n</o-popup>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | -- | |\\n| title | string | -- | |\\n| width | number | -- | |\\n| cancelText | string | -- | |\\n| confirmText | string | -- | |\\n| onClose |function | -- | |\\n| onConfirm | function | -- | |\\n| children | vdom json array | -- | |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/popup.md\n// module id = 98\n// module chunks = 11"],"sourceRoot":""}
|
|
@ -0,0 +1,2 @@
|
|||
webpackJsonp([11],{100:function(n,o){n.exports="## Popup \n\n\u5f39\u51fa\u5c42\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-popup\n onClose={this.closePopup}\n onConfirm={this.onConfirm}\n show={this.popupShow} \n title='My Title'\n cancelText='cancel'\n confirmText='confirm'\n>\n <div>I am content</div>\n <div>I am content</div>\n <div>I am content</div>\n <div>I am content</div>\n</o-popup>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| show | bool | -- | |\n| title | string | -- | |\n| width | number | -- | |\n| cancelText | string | -- | |\n| confirmText | string | -- | |\n| onClose |function | -- | |\n| onConfirm | function | -- | |\n| children | vdom json array | -- | |"}});
|
||||
//# sourceMappingURL=11.9d9a7cb8.chunk.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../static/js/11.9d9a7cb8.chunk.js","docs/zh-cn/popup.md"],"names":["webpackJsonp","100","module","exports"],"mappings":"AAAAA,cAAc,KAERC,IACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/11.9d9a7cb8.chunk.js","sourcesContent":["webpackJsonp([11],{\n\n/***/ 100:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Popup \\n\\n弹出层。\\n\\n## 使用\\n\\n```js\\n<o-popup\\n onClose={this.closePopup}\\n onConfirm={this.onConfirm}\\n show={this.popupShow} \\n title='My Title'\\n cancelText='cancel'\\n confirmText='confirm'\\n>\\n <div>I am content</div>\\n <div>I am content</div>\\n <div>I am content</div>\\n <div>I am content</div>\\n</o-popup>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | -- | |\\n| title | string | -- | |\\n| width | number | -- | |\\n| cancelText | string | -- | |\\n| confirmText | string | -- | |\\n| onClose |function | -- | |\\n| onConfirm | function | -- | |\\n| children | vdom json array | -- | |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/11.9d9a7cb8.chunk.js","module.exports = \"## Popup \\n\\n弹出层。\\n\\n## 使用\\n\\n```js\\n<o-popup\\n onClose={this.closePopup}\\n onConfirm={this.onConfirm}\\n show={this.popupShow} \\n title='My Title'\\n cancelText='cancel'\\n confirmText='confirm'\\n>\\n <div>I am content</div>\\n <div>I am content</div>\\n <div>I am content</div>\\n <div>I am content</div>\\n</o-popup>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | -- | |\\n| title | string | -- | |\\n| width | number | -- | |\\n| cancelText | string | -- | |\\n| confirmText | string | -- | |\\n| onClose |function | -- | |\\n| onConfirm | function | -- | |\\n| children | vdom json array | -- | |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/popup.md\n// module id = 100\n// module chunks = 11"],"sourceRoot":""}
|
|
@ -1,2 +1,2 @@
|
|||
webpackJsonp([12],{97:function(n,o){n.exports="## Popover \n\n\u6c14\u6ce1\u5361\u7247\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-popover \n show={this.popoverShow} \n target={this.popoverTarget} \n direction={this.direction} \n onClose={this.onClose}>\n <div>\u6d4b\u8bd5\u5185\u5bb9....</div>\n <div>\u6d4b\u8bd5\u5185\u5bb9</div>\n <div>\u6d4b\u8bd5\u5185\u5bb9\u6d4b\u8bd5\u5185\u5bb9</div>\n</o-popover>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| show | bool | -- | |\n| target | dom element | -- | \u73af\u7ed5\u7684\u76ee\u6807 |\n| direction | string | -- | \u73af\u7ed5\u7684\u65b9\u5411 |\n| onClose | function | -- | |\n| children | json array | -- | |"}});
|
||||
//# sourceMappingURL=12.259d9f0e.chunk.js.map
|
||||
webpackJsonp([12],{99:function(n,o){n.exports="## Popover \n\n\u6c14\u6ce1\u5361\u7247\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-popover \n show={this.popoverShow} \n target={this.popoverTarget} \n direction={this.direction} \n onClose={this.onClose}>\n <div>\u6d4b\u8bd5\u5185\u5bb9....</div>\n <div>\u6d4b\u8bd5\u5185\u5bb9</div>\n <div>\u6d4b\u8bd5\u5185\u5bb9\u6d4b\u8bd5\u5185\u5bb9</div>\n</o-popover>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| show | bool | -- | |\n| target | dom element | -- | \u73af\u7ed5\u7684\u76ee\u6807 |\n| direction | string | -- | \u73af\u7ed5\u7684\u65b9\u5411 |\n| onClose | function | -- | |\n| children | json array | -- | |"}});
|
||||
//# sourceMappingURL=12.7fcd6d48.chunk.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["../static/js/12.259d9f0e.chunk.js","docs/zh-cn/popover.md"],"names":["webpackJsonp","97","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/12.259d9f0e.chunk.js","sourcesContent":["webpackJsonp([12],{\n\n/***/ 97:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Popover \\n\\n气泡卡片。\\n\\n## 使用\\n\\n```js\\n<o-popover \\n show={this.popoverShow} \\n target={this.popoverTarget} \\n direction={this.direction} \\n onClose={this.onClose}>\\n <div>测试内容....</div>\\n <div>测试内容</div>\\n <div>测试内容测试内容</div>\\n</o-popover>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | -- | |\\n| target | dom element | -- | 环绕的目标 |\\n| direction | string | -- | 环绕的方向 |\\n| onClose | function | -- | |\\n| children | json array | -- | |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/12.259d9f0e.chunk.js","module.exports = \"## Popover \\n\\n气泡卡片。\\n\\n## 使用\\n\\n```js\\n<o-popover \\n show={this.popoverShow} \\n target={this.popoverTarget} \\n direction={this.direction} \\n onClose={this.onClose}>\\n <div>测试内容....</div>\\n <div>测试内容</div>\\n <div>测试内容测试内容</div>\\n</o-popover>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | -- | |\\n| target | dom element | -- | 环绕的目标 |\\n| direction | string | -- | 环绕的方向 |\\n| onClose | function | -- | |\\n| children | json array | -- | |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/popover.md\n// module id = 97\n// module chunks = 12"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../static/js/12.7fcd6d48.chunk.js","docs/zh-cn/popover.md"],"names":["webpackJsonp","99","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/12.7fcd6d48.chunk.js","sourcesContent":["webpackJsonp([12],{\n\n/***/ 99:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Popover \\n\\n气泡卡片。\\n\\n## 使用\\n\\n```js\\n<o-popover \\n show={this.popoverShow} \\n target={this.popoverTarget} \\n direction={this.direction} \\n onClose={this.onClose}>\\n <div>测试内容....</div>\\n <div>测试内容</div>\\n <div>测试内容测试内容</div>\\n</o-popover>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | -- | |\\n| target | dom element | -- | 环绕的目标 |\\n| direction | string | -- | 环绕的方向 |\\n| onClose | function | -- | |\\n| children | json array | -- | |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/12.7fcd6d48.chunk.js","module.exports = \"## Popover \\n\\n气泡卡片。\\n\\n## 使用\\n\\n```js\\n<o-popover \\n show={this.popoverShow} \\n target={this.popoverTarget} \\n direction={this.direction} \\n onClose={this.onClose}>\\n <div>测试内容....</div>\\n <div>测试内容</div>\\n <div>测试内容测试内容</div>\\n</o-popover>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| show | bool | -- | |\\n| target | dom element | -- | 环绕的目标 |\\n| direction | string | -- | 环绕的方向 |\\n| onClose | function | -- | |\\n| children | json array | -- | |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/popover.md\n// module id = 99\n// module chunks = 12"],"sourceRoot":""}
|
|
@ -1,2 +1,2 @@
|
|||
webpackJsonp([13],{96:function(n,e){n.exports="## PathProgress \n\n\u4f7f\u7528 SVG \u5c55\u793a\u4e00\u4e2a\u4efb\u52a1\u7684\u8fdb\u5ea6\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-path-progress\n type='Circle' \n progress={0.5}\n text={'test'}\n options={options}\n initialAnimate={true}\n containerStyle={{\n width: '200px',\n height: '200px'\n }}\n containerClassName={'.progressbar'}\n></o-path-progress>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| type | string| - | \u652f\u6301 Circle,Line \u548c SemiCircle |\n| progress | number| 0 | |\n| text | string| - | |\n| options | json | | |\n| initialAnimate | bool| | |\n| containerStyle | json| | |\n| containerClassName | string| | |"}});
|
||||
//# sourceMappingURL=13.a85b186a.chunk.js.map
|
||||
webpackJsonp([13],{98:function(n,e){n.exports="## PathProgress \n\n\u4f7f\u7528 SVG \u5c55\u793a\u4e00\u4e2a\u4efb\u52a1\u7684\u8fdb\u5ea6\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-path-progress\n type='Circle' \n progress={0.5}\n text={'test'}\n options={options}\n initialAnimate={true}\n containerStyle={{\n width: '200px',\n height: '200px'\n }}\n containerClassName={'.progressbar'}\n></o-path-progress>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| type | string| - | \u652f\u6301 Circle,Line \u548c SemiCircle |\n| progress | number| 0 | |\n| text | string| - | |\n| options | json | | |\n| initialAnimate | bool| | |\n| containerStyle | json| | |\n| containerClassName | string| | |"}});
|
||||
//# sourceMappingURL=13.e822e9e7.chunk.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["../static/js/13.a85b186a.chunk.js","docs/zh-cn/path-progress.md"],"names":["webpackJsonp","96","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/13.a85b186a.chunk.js","sourcesContent":["webpackJsonp([13],{\n\n/***/ 96:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## PathProgress \\n\\n使用 SVG 展示一个任务的进度。\\n\\n## 使用\\n\\n```js\\n<o-path-progress\\n type='Circle' \\n progress={0.5}\\n text={'test'}\\n options={options}\\n initialAnimate={true}\\n containerStyle={{\\n width: '200px',\\n height: '200px'\\n }}\\n containerClassName={'.progressbar'}\\n></o-path-progress>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| type | string| - | 支持 Circle,Line 和 SemiCircle |\\n| progress | number| 0 | |\\n| text | string| - | |\\n| options | json | | |\\n| initialAnimate | bool| | |\\n| containerStyle | json| | |\\n| containerClassName | string| | |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/13.a85b186a.chunk.js","module.exports = \"## PathProgress \\n\\n使用 SVG 展示一个任务的进度。\\n\\n## 使用\\n\\n```js\\n<o-path-progress\\n type='Circle' \\n progress={0.5}\\n text={'test'}\\n options={options}\\n initialAnimate={true}\\n containerStyle={{\\n width: '200px',\\n height: '200px'\\n }}\\n containerClassName={'.progressbar'}\\n></o-path-progress>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| type | string| - | 支持 Circle,Line 和 SemiCircle |\\n| progress | number| 0 | |\\n| text | string| - | |\\n| options | json | | |\\n| initialAnimate | bool| | |\\n| containerStyle | json| | |\\n| containerClassName | string| | |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/path-progress.md\n// module id = 96\n// module chunks = 13"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../static/js/13.e822e9e7.chunk.js","docs/zh-cn/path-progress.md"],"names":["webpackJsonp","98","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/13.e822e9e7.chunk.js","sourcesContent":["webpackJsonp([13],{\n\n/***/ 98:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## PathProgress \\n\\n使用 SVG 展示一个任务的进度。\\n\\n## 使用\\n\\n```js\\n<o-path-progress\\n type='Circle' \\n progress={0.5}\\n text={'test'}\\n options={options}\\n initialAnimate={true}\\n containerStyle={{\\n width: '200px',\\n height: '200px'\\n }}\\n containerClassName={'.progressbar'}\\n></o-path-progress>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| type | string| - | 支持 Circle,Line 和 SemiCircle |\\n| progress | number| 0 | |\\n| text | string| - | |\\n| options | json | | |\\n| initialAnimate | bool| | |\\n| containerStyle | json| | |\\n| containerClassName | string| | |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/13.e822e9e7.chunk.js","module.exports = \"## PathProgress \\n\\n使用 SVG 展示一个任务的进度。\\n\\n## 使用\\n\\n```js\\n<o-path-progress\\n type='Circle' \\n progress={0.5}\\n text={'test'}\\n options={options}\\n initialAnimate={true}\\n containerStyle={{\\n width: '200px',\\n height: '200px'\\n }}\\n containerClassName={'.progressbar'}\\n></o-path-progress>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| type | string| - | 支持 Circle,Line 和 SemiCircle |\\n| progress | number| 0 | |\\n| text | string| - | |\\n| options | json | | |\\n| initialAnimate | bool| | |\\n| containerStyle | json| | |\\n| containerClassName | string| | |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/path-progress.md\n// module id = 98\n// module chunks = 13"],"sourceRoot":""}
|
|
@ -1,2 +1,2 @@
|
|||
webpackJsonp([14],{95:function(n,e){n.exports="## Pagination \n\n\u5206\u9875\u7ec4\u4ef6.\n\n## \u4f7f\u7528\n\n```js\n<o-pagination\n total={25}\n currentPage={1}\n pageSize={5}\n onChange={this.onChange}\n/>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| total | number| -- | |\n| currentPage | number | 0 | |\n| pageSize | number | 10 | |\n| numDisplay | number| 5 ||\n| numEdge | number| 3 ||\n| ellipseText | string| ... ||"}});
|
||||
//# sourceMappingURL=14.a06793bd.chunk.js.map
|
||||
webpackJsonp([14],{97:function(n,e){n.exports="## Pagination \n\n\u5206\u9875\u7ec4\u4ef6.\n\n## \u4f7f\u7528\n\n```js\n<o-pagination\n total={25}\n currentPage={1}\n pageSize={5}\n onChange={this.onChange}\n/>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| total | number| -- | |\n| currentPage | number | 0 | |\n| pageSize | number | 10 | |\n| numDisplay | number| 5 ||\n| numEdge | number| 3 ||\n| ellipseText | string| ... ||"}});
|
||||
//# sourceMappingURL=14.8a3f05bd.chunk.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["../static/js/14.a06793bd.chunk.js","docs/zh-cn/pagination.md"],"names":["webpackJsonp","95","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/14.a06793bd.chunk.js","sourcesContent":["webpackJsonp([14],{\n\n/***/ 95:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Pagination \\n\\n分页组件.\\n\\n## 使用\\n\\n```js\\n<o-pagination\\n total={25}\\n currentPage={1}\\n pageSize={5}\\n onChange={this.onChange}\\n/>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| total | number| -- | |\\n| currentPage | number | 0 | |\\n| pageSize | number | 10 | |\\n| numDisplay | number| 5 ||\\n| numEdge | number| 3 ||\\n| ellipseText | string| ... ||\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/14.a06793bd.chunk.js","module.exports = \"## Pagination \\n\\n分页组件.\\n\\n## 使用\\n\\n```js\\n<o-pagination\\n total={25}\\n currentPage={1}\\n pageSize={5}\\n onChange={this.onChange}\\n/>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| total | number| -- | |\\n| currentPage | number | 0 | |\\n| pageSize | number | 10 | |\\n| numDisplay | number| 5 ||\\n| numEdge | number| 3 ||\\n| ellipseText | string| ... ||\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/pagination.md\n// module id = 95\n// module chunks = 14"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../static/js/14.8a3f05bd.chunk.js","docs/zh-cn/pagination.md"],"names":["webpackJsonp","97","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/14.8a3f05bd.chunk.js","sourcesContent":["webpackJsonp([14],{\n\n/***/ 97:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Pagination \\n\\n分页组件.\\n\\n## 使用\\n\\n```js\\n<o-pagination\\n total={25}\\n currentPage={1}\\n pageSize={5}\\n onChange={this.onChange}\\n/>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| total | number| -- | |\\n| currentPage | number | 0 | |\\n| pageSize | number | 10 | |\\n| numDisplay | number| 5 ||\\n| numEdge | number| 3 ||\\n| ellipseText | string| ... ||\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/14.8a3f05bd.chunk.js","module.exports = \"## Pagination \\n\\n分页组件.\\n\\n## 使用\\n\\n```js\\n<o-pagination\\n total={25}\\n currentPage={1}\\n pageSize={5}\\n onChange={this.onChange}\\n/>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| total | number| -- | |\\n| currentPage | number | 0 | |\\n| pageSize | number | 10 | |\\n| numDisplay | number| 5 ||\\n| numEdge | number| 3 ||\\n| ellipseText | string| ... ||\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/pagination.md\n// module id = 97\n// module chunks = 14"],"sourceRoot":""}
|
|
@ -1,2 +1,2 @@
|
|||
webpackJsonp([15],{94:function(n,e){n.exports="## Nav \n\n\u5bfc\u822a\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-nav>\n <item active={true}>NavA</item>\n <item>NavB</item>\n</o-nav>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------|\n| onChange | function | -- | |\u3000\n| children | json array | -- | |\u3000"}});
|
||||
//# sourceMappingURL=15.76347967.chunk.js.map
|
||||
webpackJsonp([15],{96:function(n,e){n.exports="## Nav \n\n\u5bfc\u822a\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-nav>\n <item active={true}>NavA</item>\n <item>NavB</item>\n</o-nav>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------|\n| onChange | function | -- | |\u3000\n| children | json array | -- | |\u3000"}});
|
||||
//# sourceMappingURL=15.2d9b0995.chunk.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["../static/js/15.76347967.chunk.js","docs/zh-cn/nav.md"],"names":["webpackJsonp","94","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/15.76347967.chunk.js","sourcesContent":["webpackJsonp([15],{\n\n/***/ 94:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Nav \\n\\n导航。\\n\\n## 使用\\n\\n```js\\n<o-nav>\\n <item active={true}>NavA</item>\\n <item>NavB</item>\\n</o-nav>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------|\\n| onChange | function | -- | | \\n| children | json array | -- | | \"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/15.76347967.chunk.js","module.exports = \"## Nav \\n\\n导航。\\n\\n## 使用\\n\\n```js\\n<o-nav>\\n <item active={true}>NavA</item>\\n <item>NavB</item>\\n</o-nav>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------|\\n| onChange | function | -- | | \\n| children | json array | -- | | \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/nav.md\n// module id = 94\n// module chunks = 15"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../static/js/15.2d9b0995.chunk.js","docs/zh-cn/nav.md"],"names":["webpackJsonp","96","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/15.2d9b0995.chunk.js","sourcesContent":["webpackJsonp([15],{\n\n/***/ 96:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Nav \\n\\n导航。\\n\\n## 使用\\n\\n```js\\n<o-nav>\\n <item active={true}>NavA</item>\\n <item>NavB</item>\\n</o-nav>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------|\\n| onChange | function | -- | | \\n| children | json array | -- | | \"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/15.2d9b0995.chunk.js","module.exports = \"## Nav \\n\\n导航。\\n\\n## 使用\\n\\n```js\\n<o-nav>\\n <item active={true}>NavA</item>\\n <item>NavB</item>\\n</o-nav>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------|\\n| onChange | function | -- | | \\n| children | json array | -- | | \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/nav.md\n// module id = 96\n// module chunks = 15"],"sourceRoot":""}
|
|
@ -1,2 +1,2 @@
|
|||
webpackJsonp([16],{93:function(n,o){n.exports="## Omiu \n\nOmiu \u662f Omi \u5b98\u65b9 UI \u7ec4\u4ef6\u5e93\uff0c\u57fa\u4e8e Omio(IE8+) \u4e14\u517c\u5bb9 Omi,\u4f7f\u7528\u5fae\u4fe1 7.0 \u8bbe\u8ba1\u98ce\u683c\u3002\n\n## \u8272\u5f69\n\n| **\u989c\u8272** | **\u610f\u4e49** |\n| ------------- |:-------------:|\n| #07C160 | \u5c0a\u8d35\u6d3b\u529b\u7eff | \n| #171717 | \u6c89\u7a33\u5178\u96c5\u9ed1 | \n| #FEFEFE | \u6e05\u65b0\u8131\u4fd7\u767d | \n| #F95050 | \u6c14\u8d28\u9192\u76ee\u7ea2 | \n| #ECECEC | \u8ff7\u60d8\u6de1\u6cca\u7070 | \n\n## \u65b0\u9879\u76ee\u5feb\u901f\u4f7f\u7528\n\n```\nnpm i omi-cli -g \nomi init my-app \ncd my-app \nnpm start \nnpm run build \n```\n\n> `npx omi-cli init my-app` \u4e5f\u652f\u6301(\u8981\u6c42 npm v5.2.0+)\n\n## \u73b0\u6709\u9879\u76ee\u4f7f\u7528\n\n```js\nnpm i omiu\n```\n\n```js\nimport { WeElement, define, render } from 'omi'\n//node modules \u4e0b\u7684 omiu \u7ec4\u4ef6\u90fd\u662f E6+,\u4f60\u9700\u8981\u628a node modules \u4e0b\u7684 js \u4e5f\u8bbe\u7f6e\u6210\u7ecf\u8fc7 babel \u6216 ts \u7f16\u8bd1\u624d\u80fd\u6b63\u5e38\u8dd1\u8d77\u6765\nimport 'omiu/button'\n\n//\u6216\u8005\u5bfc\u5165\u6240\u6709\u7ec4\u4ef6\uff0cnode modules \u7684 omi.js \u662f ES5 \u7684\uff0c\u4e0d\u9700\u8981\u989d\u5916\u914d\u7f6e\n//import 'omiu'\n\ndefine('my-app', class extends WeElement {\n onClick = () => {\n console.log('Hello omiu!');\n }\n\n render() {\n return (\n <o-button onClick={this.onClick}>\u6309\u94ae</o-button>\n )\n }\n})\n\nrender(<my-app />, 'body')\n```"}});
|
||||
//# sourceMappingURL=16.125ac98e.chunk.js.map
|
||||
webpackJsonp([16],{95:function(n,o){n.exports="## Omiu \n\nOmiu \u662f Omi \u5b98\u65b9 UI \u7ec4\u4ef6\u5e93\uff0c\u57fa\u4e8e Omio(IE8+) \u4e14\u517c\u5bb9 Omi,\u4f7f\u7528\u5fae\u4fe1 7.0 \u8bbe\u8ba1\u98ce\u683c\u3002\n\n## \u8272\u5f69\n\n| **\u989c\u8272** | **\u610f\u4e49** |\n| ------------- |:-------------:|\n| #07C160 | \u5c0a\u8d35\u6d3b\u529b\u7eff | \n| #171717 | \u6c89\u7a33\u5178\u96c5\u9ed1 | \n| #FEFEFE | \u6e05\u65b0\u8131\u4fd7\u767d | \n| #F95050 | \u6c14\u8d28\u9192\u76ee\u7ea2 | \n| #ECECEC | \u8ff7\u60d8\u6de1\u6cca\u7070 | \n\n## \u65b0\u9879\u76ee\u5feb\u901f\u4f7f\u7528\n\n```\nnpm i omi-cli -g \nomi init my-app \ncd my-app \nnpm start \nnpm run build \n```\n\n> `npx omi-cli init my-app` \u4e5f\u652f\u6301(\u8981\u6c42 npm v5.2.0+)\n\n## \u73b0\u6709\u9879\u76ee\u4f7f\u7528\n\n```js\nnpm i omiu\n```\n\n```js\nimport { WeElement, define, render } from 'omi'\n//node modules \u4e0b\u7684 omiu \u7ec4\u4ef6\u90fd\u662f E6+,\u4f60\u9700\u8981\u628a node modules \u4e0b\u7684 js \u4e5f\u8bbe\u7f6e\u6210\u7ecf\u8fc7 babel \u6216 ts \u7f16\u8bd1\u624d\u80fd\u6b63\u5e38\u8dd1\u8d77\u6765\nimport 'omiu/button'\n\n//\u6216\u8005\u5bfc\u5165\u6240\u6709\u7ec4\u4ef6\uff0cnode modules \u7684 omi.js \u662f ES5 \u7684\uff0c\u4e0d\u9700\u8981\u989d\u5916\u914d\u7f6e\n//import 'omiu'\n\ndefine('my-app', class extends WeElement {\n onClick = () => {\n console.log('Hello omiu!');\n }\n\n render() {\n return (\n <o-button onClick={this.onClick}>\u6309\u94ae</o-button>\n )\n }\n})\n\nrender(<my-app />, 'body')\n```"}});
|
||||
//# sourceMappingURL=16.6839e27a.chunk.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["../static/js/16.125ac98e.chunk.js","docs/zh-cn/introduction.md"],"names":["webpackJsonp","93","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/16.125ac98e.chunk.js","sourcesContent":["webpackJsonp([16],{\n\n/***/ 93:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Omiu \\n\\nOmiu 是 Omi 官方 UI 组件库,基于 Omio(IE8+) 且兼容 Omi,使用微信 7.0 设计风格。\\n\\n## 色彩\\n\\n| **颜色** | **意义** |\\n| ------------- |:-------------:|\\n| #07C160 | 尊贵活力绿 | \\n| #171717 | 沉稳典雅黑 | \\n| #FEFEFE | 清新脱俗白 | \\n| #F95050 | 气质醒目红 | \\n| #ECECEC | 迷惘淡泊灰 | \\n\\n## 新项目快速使用\\n\\n```\\nnpm i omi-cli -g \\nomi init my-app \\ncd my-app \\nnpm start \\nnpm run build \\n```\\n\\n> `npx omi-cli init my-app` 也支持(要求 npm v5.2.0+)\\n\\n## 现有项目使用\\n\\n```js\\nnpm i omiu\\n```\\n\\n```js\\nimport { WeElement, define, render } from 'omi'\\n//node modules 下的 omiu 组件都是 E6+,你需要把 node modules 下的 js 也设置成经过 babel 或 ts 编译才能正常跑起来\\nimport 'omiu/button'\\n\\n//或者导入所有组件,node modules 的 omi.js 是 ES5 的,不需要额外配置\\n//import 'omiu'\\n\\ndefine('my-app', class extends WeElement {\\n onClick = () => {\\n console.log('Hello omiu!');\\n }\\n\\n render() {\\n return (\\n <o-button onClick={this.onClick}>按钮</o-button>\\n )\\n }\\n})\\n\\nrender(<my-app />, 'body')\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/16.125ac98e.chunk.js","module.exports = \"## Omiu \\n\\nOmiu 是 Omi 官方 UI 组件库,基于 Omio(IE8+) 且兼容 Omi,使用微信 7.0 设计风格。\\n\\n## 色彩\\n\\n| **颜色** | **意义** |\\n| ------------- |:-------------:|\\n| #07C160 | 尊贵活力绿 | \\n| #171717 | 沉稳典雅黑 | \\n| #FEFEFE | 清新脱俗白 | \\n| #F95050 | 气质醒目红 | \\n| #ECECEC | 迷惘淡泊灰 | \\n\\n## 新项目快速使用\\n\\n```\\nnpm i omi-cli -g \\nomi init my-app \\ncd my-app \\nnpm start \\nnpm run build \\n```\\n\\n> `npx omi-cli init my-app` 也支持(要求 npm v5.2.0+)\\n\\n## 现有项目使用\\n\\n```js\\nnpm i omiu\\n```\\n\\n```js\\nimport { WeElement, define, render } from 'omi'\\n//node modules 下的 omiu 组件都是 E6+,你需要把 node modules 下的 js 也设置成经过 babel 或 ts 编译才能正常跑起来\\nimport 'omiu/button'\\n\\n//或者导入所有组件,node modules 的 omi.js 是 ES5 的,不需要额外配置\\n//import 'omiu'\\n\\ndefine('my-app', class extends WeElement {\\n onClick = () => {\\n console.log('Hello omiu!');\\n }\\n\\n render() {\\n return (\\n <o-button onClick={this.onClick}>按钮</o-button>\\n )\\n }\\n})\\n\\nrender(<my-app />, 'body')\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/introduction.md\n// module id = 93\n// module chunks = 16"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../static/js/16.6839e27a.chunk.js","docs/zh-cn/introduction.md"],"names":["webpackJsonp","95","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/16.6839e27a.chunk.js","sourcesContent":["webpackJsonp([16],{\n\n/***/ 95:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Omiu \\n\\nOmiu 是 Omi 官方 UI 组件库,基于 Omio(IE8+) 且兼容 Omi,使用微信 7.0 设计风格。\\n\\n## 色彩\\n\\n| **颜色** | **意义** |\\n| ------------- |:-------------:|\\n| #07C160 | 尊贵活力绿 | \\n| #171717 | 沉稳典雅黑 | \\n| #FEFEFE | 清新脱俗白 | \\n| #F95050 | 气质醒目红 | \\n| #ECECEC | 迷惘淡泊灰 | \\n\\n## 新项目快速使用\\n\\n```\\nnpm i omi-cli -g \\nomi init my-app \\ncd my-app \\nnpm start \\nnpm run build \\n```\\n\\n> `npx omi-cli init my-app` 也支持(要求 npm v5.2.0+)\\n\\n## 现有项目使用\\n\\n```js\\nnpm i omiu\\n```\\n\\n```js\\nimport { WeElement, define, render } from 'omi'\\n//node modules 下的 omiu 组件都是 E6+,你需要把 node modules 下的 js 也设置成经过 babel 或 ts 编译才能正常跑起来\\nimport 'omiu/button'\\n\\n//或者导入所有组件,node modules 的 omi.js 是 ES5 的,不需要额外配置\\n//import 'omiu'\\n\\ndefine('my-app', class extends WeElement {\\n onClick = () => {\\n console.log('Hello omiu!');\\n }\\n\\n render() {\\n return (\\n <o-button onClick={this.onClick}>按钮</o-button>\\n )\\n }\\n})\\n\\nrender(<my-app />, 'body')\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/16.6839e27a.chunk.js","module.exports = \"## Omiu \\n\\nOmiu 是 Omi 官方 UI 组件库,基于 Omio(IE8+) 且兼容 Omi,使用微信 7.0 设计风格。\\n\\n## 色彩\\n\\n| **颜色** | **意义** |\\n| ------------- |:-------------:|\\n| #07C160 | 尊贵活力绿 | \\n| #171717 | 沉稳典雅黑 | \\n| #FEFEFE | 清新脱俗白 | \\n| #F95050 | 气质醒目红 | \\n| #ECECEC | 迷惘淡泊灰 | \\n\\n## 新项目快速使用\\n\\n```\\nnpm i omi-cli -g \\nomi init my-app \\ncd my-app \\nnpm start \\nnpm run build \\n```\\n\\n> `npx omi-cli init my-app` 也支持(要求 npm v5.2.0+)\\n\\n## 现有项目使用\\n\\n```js\\nnpm i omiu\\n```\\n\\n```js\\nimport { WeElement, define, render } from 'omi'\\n//node modules 下的 omiu 组件都是 E6+,你需要把 node modules 下的 js 也设置成经过 babel 或 ts 编译才能正常跑起来\\nimport 'omiu/button'\\n\\n//或者导入所有组件,node modules 的 omi.js 是 ES5 的,不需要额外配置\\n//import 'omiu'\\n\\ndefine('my-app', class extends WeElement {\\n onClick = () => {\\n console.log('Hello omiu!');\\n }\\n\\n render() {\\n return (\\n <o-button onClick={this.onClick}>按钮</o-button>\\n )\\n }\\n})\\n\\nrender(<my-app />, 'body')\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/introduction.md\n// module id = 95\n// module chunks = 16"],"sourceRoot":""}
|
|
@ -1,2 +1,2 @@
|
|||
webpackJsonp([17],{92:function(n,e){n.exports="## Input \n\n\u7528\u6237\u7684\u8f93\u5165\u6846\uff0c\u8f93\u5165\u4e00\u4e9b\u5185\u5bb9\u7528\u6765\u63d0\u4ea4\u7ed9\u670d\u52a1\u5668\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-input placeholder=\"\u8bf7\u8f93\u5165\u7528\u6237\u540d\" />\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| placeholder | string| | \u5360\u4f4d\u5b57\u7b26\u4e32 |\n\n## \u5176\u4ed6\u7c7b\u578b\n\n```js\n<o-input-label label='UserName' />\n<o-input-button buttonText='\u63d0\u4ea4' onClick={this.onClick} />\n```"}});
|
||||
//# sourceMappingURL=17.19d413fa.chunk.js.map
|
||||
webpackJsonp([17],{94:function(n,e){n.exports="## Input \n\n\u7528\u6237\u7684\u8f93\u5165\u6846\uff0c\u8f93\u5165\u4e00\u4e9b\u5185\u5bb9\u7528\u6765\u63d0\u4ea4\u7ed9\u670d\u52a1\u5668\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-input placeholder=\"\u8bf7\u8f93\u5165\u7528\u6237\u540d\" />\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| placeholder | string| | \u5360\u4f4d\u5b57\u7b26\u4e32 |\n\n## \u5176\u4ed6\u7c7b\u578b\n\n```js\n<o-input-label label='UserName' />\n<o-input-button buttonText='\u63d0\u4ea4' onClick={this.onClick} />\n```"}});
|
||||
//# sourceMappingURL=17.49ea9d72.chunk.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["../static/js/17.19d413fa.chunk.js","docs/zh-cn/input.md"],"names":["webpackJsonp","92","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/17.19d413fa.chunk.js","sourcesContent":["webpackJsonp([17],{\n\n/***/ 92:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Input \\n\\n用户的输入框,输入一些内容用来提交给服务器。\\n\\n## 使用\\n\\n```js\\n<o-input placeholder=\\\"请输入用户名\\\" />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| placeholder | string| | 占位字符串 |\\n\\n## 其他类型\\n\\n```js\\n<o-input-label label='UserName' />\\n<o-input-button buttonText='提交' onClick={this.onClick} />\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/17.19d413fa.chunk.js","module.exports = \"## Input \\n\\n用户的输入框,输入一些内容用来提交给服务器。\\n\\n## 使用\\n\\n```js\\n<o-input placeholder=\\\"请输入用户名\\\" />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| placeholder | string| | 占位字符串 |\\n\\n## 其他类型\\n\\n```js\\n<o-input-label label='UserName' />\\n<o-input-button buttonText='提交' onClick={this.onClick} />\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/input.md\n// module id = 92\n// module chunks = 17"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../static/js/17.49ea9d72.chunk.js","docs/zh-cn/input.md"],"names":["webpackJsonp","94","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/17.49ea9d72.chunk.js","sourcesContent":["webpackJsonp([17],{\n\n/***/ 94:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Input \\n\\n用户的输入框,输入一些内容用来提交给服务器。\\n\\n## 使用\\n\\n```js\\n<o-input placeholder=\\\"请输入用户名\\\" />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| placeholder | string| | 占位字符串 |\\n\\n## 其他类型\\n\\n```js\\n<o-input-label label='UserName' />\\n<o-input-button buttonText='提交' onClick={this.onClick} />\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/17.49ea9d72.chunk.js","module.exports = \"## Input \\n\\n用户的输入框,输入一些内容用来提交给服务器。\\n\\n## 使用\\n\\n```js\\n<o-input placeholder=\\\"请输入用户名\\\" />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| placeholder | string| | 占位字符串 |\\n\\n## 其他类型\\n\\n```js\\n<o-input-label label='UserName' />\\n<o-input-button buttonText='提交' onClick={this.onClick} />\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/input.md\n// module id = 94\n// module chunks = 17"],"sourceRoot":""}
|
|
@ -1,2 +1,2 @@
|
|||
webpackJsonp([18],{91:function(n,e){n.exports="## InputTable \n\n\u53ef\u7f16\u8f91\u7684\u8868\u683c\u3002\n\n## \u4f7f\u7528\n\n```js\ndefine('my-app', class extends WeElement {\n dataSource = [{\n id: 1,\n name: 'xwang',\n age: 18,\n address: '\u817e\u8baf\u5927\u53a6'\n }, {\n id: 2,\n name: 'dntzhang',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 3,\n name: 'dntzhang2',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 4,\n name: 'dntzhang3',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 5,\n name: 'dntzhang4',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }];\n\n columns = [{\n title: '\u59d3\u540d',\n key: 'name',\n }, {\n title: '\u5e74\u9f84',\n key: 'age',\n }, {\n title: '\u4f4f\u5740',\n key: 'address',\n }]\n\n\n render() {\n return (\n <o-input-table\n dataSource={this.dataSource}\n columns={this.columns}>\n </o-input-table>\n )\n }\n})\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| dataSource | json array | -- | |\n| columns | json array | -- | |"}});
|
||||
//# sourceMappingURL=18.dfc4a6d0.chunk.js.map
|
||||
webpackJsonp([18],{93:function(n,e){n.exports="## InputTable \n\n\u53ef\u7f16\u8f91\u7684\u8868\u683c\u3002\n\n## \u4f7f\u7528\n\n```js\ndefine('my-app', class extends WeElement {\n dataSource = [{\n id: 1,\n name: 'xwang',\n age: 18,\n address: '\u817e\u8baf\u5927\u53a6'\n }, {\n id: 2,\n name: 'dntzhang',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 3,\n name: 'dntzhang2',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 4,\n name: 'dntzhang3',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 5,\n name: 'dntzhang4',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }];\n\n columns = [{\n title: '\u59d3\u540d',\n key: 'name',\n }, {\n title: '\u5e74\u9f84',\n key: 'age',\n }, {\n title: '\u4f4f\u5740',\n key: 'address',\n }]\n\n\n render() {\n return (\n <o-input-table\n dataSource={this.dataSource}\n columns={this.columns}>\n </o-input-table>\n )\n }\n})\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| dataSource | json array | -- | |\n| columns | json array | -- | |"}});
|
||||
//# sourceMappingURL=18.7254d5e3.chunk.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["../static/js/18.dfc4a6d0.chunk.js","docs/zh-cn/input-table.md"],"names":["webpackJsonp","91","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/18.dfc4a6d0.chunk.js","sourcesContent":["webpackJsonp([18],{\n\n/***/ 91:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## InputTable \\n\\n可编辑的表格。\\n\\n## 使用\\n\\n```js\\ndefine('my-app', class extends WeElement {\\n dataSource = [{\\n id: 1,\\n name: 'xwang',\\n age: 18,\\n address: '腾讯大厦'\\n }, {\\n id: 2,\\n name: 'dntzhang',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 3,\\n name: 'dntzhang2',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 4,\\n name: 'dntzhang3',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 5,\\n name: 'dntzhang4',\\n age: 12,\\n address: '滨海大厦'\\n }];\\n\\n columns = [{\\n title: '姓名',\\n key: 'name',\\n }, {\\n title: '年龄',\\n key: 'age',\\n }, {\\n title: '住址',\\n key: 'address',\\n }]\\n\\n\\n render() {\\n return (\\n <o-input-table\\n dataSource={this.dataSource}\\n columns={this.columns}>\\n </o-input-table>\\n )\\n }\\n})\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| dataSource | json array | -- | |\\n| columns | json array | -- | |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/18.dfc4a6d0.chunk.js","module.exports = \"## InputTable \\n\\n可编辑的表格。\\n\\n## 使用\\n\\n```js\\ndefine('my-app', class extends WeElement {\\n dataSource = [{\\n id: 1,\\n name: 'xwang',\\n age: 18,\\n address: '腾讯大厦'\\n }, {\\n id: 2,\\n name: 'dntzhang',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 3,\\n name: 'dntzhang2',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 4,\\n name: 'dntzhang3',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 5,\\n name: 'dntzhang4',\\n age: 12,\\n address: '滨海大厦'\\n }];\\n\\n columns = [{\\n title: '姓名',\\n key: 'name',\\n }, {\\n title: '年龄',\\n key: 'age',\\n }, {\\n title: '住址',\\n key: 'address',\\n }]\\n\\n\\n render() {\\n return (\\n <o-input-table\\n dataSource={this.dataSource}\\n columns={this.columns}>\\n </o-input-table>\\n )\\n }\\n})\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| dataSource | json array | -- | |\\n| columns | json array | -- | |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/input-table.md\n// module id = 91\n// module chunks = 18"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../static/js/18.7254d5e3.chunk.js","docs/zh-cn/input-table.md"],"names":["webpackJsonp","93","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/18.7254d5e3.chunk.js","sourcesContent":["webpackJsonp([18],{\n\n/***/ 93:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## InputTable \\n\\n可编辑的表格。\\n\\n## 使用\\n\\n```js\\ndefine('my-app', class extends WeElement {\\n dataSource = [{\\n id: 1,\\n name: 'xwang',\\n age: 18,\\n address: '腾讯大厦'\\n }, {\\n id: 2,\\n name: 'dntzhang',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 3,\\n name: 'dntzhang2',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 4,\\n name: 'dntzhang3',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 5,\\n name: 'dntzhang4',\\n age: 12,\\n address: '滨海大厦'\\n }];\\n\\n columns = [{\\n title: '姓名',\\n key: 'name',\\n }, {\\n title: '年龄',\\n key: 'age',\\n }, {\\n title: '住址',\\n key: 'address',\\n }]\\n\\n\\n render() {\\n return (\\n <o-input-table\\n dataSource={this.dataSource}\\n columns={this.columns}>\\n </o-input-table>\\n )\\n }\\n})\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| dataSource | json array | -- | |\\n| columns | json array | -- | |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/18.7254d5e3.chunk.js","module.exports = \"## InputTable \\n\\n可编辑的表格。\\n\\n## 使用\\n\\n```js\\ndefine('my-app', class extends WeElement {\\n dataSource = [{\\n id: 1,\\n name: 'xwang',\\n age: 18,\\n address: '腾讯大厦'\\n }, {\\n id: 2,\\n name: 'dntzhang',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 3,\\n name: 'dntzhang2',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 4,\\n name: 'dntzhang3',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 5,\\n name: 'dntzhang4',\\n age: 12,\\n address: '滨海大厦'\\n }];\\n\\n columns = [{\\n title: '姓名',\\n key: 'name',\\n }, {\\n title: '年龄',\\n key: 'age',\\n }, {\\n title: '住址',\\n key: 'address',\\n }]\\n\\n\\n render() {\\n return (\\n <o-input-table\\n dataSource={this.dataSource}\\n columns={this.columns}>\\n </o-input-table>\\n )\\n }\\n})\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| dataSource | json array | -- | |\\n| columns | json array | -- | |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/input-table.md\n// module id = 93\n// module chunks = 18"],"sourceRoot":""}
|
|
@ -1,2 +1,2 @@
|
|||
webpackJsonp([19],{90:function(n,e){n.exports='## InputNumber \n\n\u53ef\u4ee5\u8c03\u6574\u7684\u6570\u5b57\u8f93\u5165\u6846\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-input-number\n onChange={this.onInputNumberChange}\n min={1}\n max={10}\n step={1}\n value={2}\n label="\u63cf\u8ff0\u6587\u5b57"\n/>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| min | number|-- ||\n| max | number| -- | |\n| step | number | | |\n| value | number| -- ||\n| label | string| -- ||\n| onChange | function| -- ||\n\n\n'}});
|
||||
//# sourceMappingURL=19.77318125.chunk.js.map
|
||||
webpackJsonp([19],{92:function(n,e){n.exports='## InputNumber \n\n\u53ef\u4ee5\u8c03\u6574\u7684\u6570\u5b57\u8f93\u5165\u6846\u3002\n\n## \u4f7f\u7528\n\n```js\n<o-input-number\n onChange={this.onInputNumberChange}\n min={1}\n max={10}\n step={1}\n value={2}\n label="\u63cf\u8ff0\u6587\u5b57"\n/>\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| min | number|-- ||\n| max | number| -- | |\n| step | number | | |\n| value | number| -- ||\n| label | string| -- ||\n| onChange | function| -- ||\n\n\n'}});
|
||||
//# sourceMappingURL=19.6ea4e88d.chunk.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["../static/js/19.77318125.chunk.js","docs/zh-cn/input-number.md"],"names":["webpackJsonp","90","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/19.77318125.chunk.js","sourcesContent":["webpackJsonp([19],{\n\n/***/ 90:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## InputNumber \\n\\n可以调整的数字输入框。\\n\\n## 使用\\n\\n```js\\n<o-input-number\\n onChange={this.onInputNumberChange}\\n min={1}\\n max={10}\\n step={1}\\n value={2}\\n label=\\\"描述文字\\\"\\n/>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| min | number|-- ||\\n| max | number| -- | |\\n| step | number | | |\\n| value | number| -- ||\\n| label | string| -- ||\\n| onChange | function| -- ||\\n\\n\\n\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/19.77318125.chunk.js","module.exports = \"## InputNumber \\n\\n可以调整的数字输入框。\\n\\n## 使用\\n\\n```js\\n<o-input-number\\n onChange={this.onInputNumberChange}\\n min={1}\\n max={10}\\n step={1}\\n value={2}\\n label=\\\"描述文字\\\"\\n/>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| min | number|-- ||\\n| max | number| -- | |\\n| step | number | | |\\n| value | number| -- ||\\n| label | string| -- ||\\n| onChange | function| -- ||\\n\\n\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/input-number.md\n// module id = 90\n// module chunks = 19"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../static/js/19.6ea4e88d.chunk.js","docs/zh-cn/input-number.md"],"names":["webpackJsonp","92","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/19.6ea4e88d.chunk.js","sourcesContent":["webpackJsonp([19],{\n\n/***/ 92:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## InputNumber \\n\\n可以调整的数字输入框。\\n\\n## 使用\\n\\n```js\\n<o-input-number\\n onChange={this.onInputNumberChange}\\n min={1}\\n max={10}\\n step={1}\\n value={2}\\n label=\\\"描述文字\\\"\\n/>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| min | number|-- ||\\n| max | number| -- | |\\n| step | number | | |\\n| value | number| -- ||\\n| label | string| -- ||\\n| onChange | function| -- ||\\n\\n\\n\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/19.6ea4e88d.chunk.js","module.exports = \"## InputNumber \\n\\n可以调整的数字输入框。\\n\\n## 使用\\n\\n```js\\n<o-input-number\\n onChange={this.onInputNumberChange}\\n min={1}\\n max={10}\\n step={1}\\n value={2}\\n label=\\\"描述文字\\\"\\n/>\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| min | number|-- ||\\n| max | number| -- | |\\n| step | number | | |\\n| value | number| -- ||\\n| label | string| -- ||\\n| onChange | function| -- ||\\n\\n\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/input-number.md\n// module id = 92\n// module chunks = 19"],"sourceRoot":""}
|
|
@ -1,2 +1,2 @@
|
|||
webpackJsonp([2],{107:function(n,e){n.exports="## Table \n\n\u8868\u683c\u7684\u5f62\u5f0f\u5c55\u73b0\u548c\u5904\u7406\u6570\u636e\u3002\n\n## \u4f7f\u7528\n\n```js\ndefine('my-app', class extends WeElement {\n dataSource = [{\n id: 1,\n name: 'xwang',\n age: 18,\n address: '\u817e\u8baf\u5927\u53a6'\n }, {\n id: 2,\n name: 'dntzhang',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 3,\n name: 'dntzhang2',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 4,\n name: 'dntzhang3',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 5,\n name: 'dntzhang4',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }]\n\n columns = [{\n title: '\u59d3\u540d',\n key: 'name',\n }, {\n title: '\u5e74\u9f84',\n key: 'age',\n }, {\n title: '\u4f4f\u5740',\n key: 'address',\n }, {\n title: '\u64cd\u4f5c',\n render: (item) => (\n <span>\n <a href=\"javascript:;\" onClick={e => { this.removeItem(item) }}>Delete</a>\n </span>\n )\n }]\n\n removeItem = (item) => {\n this.table.removeItem(item)\n }\n\n render() {\n return (\n <o-table \n ref={e => { this.table = e }} \n dataSource={this.dataSource} \n columns={this.columns}>\n </o-table>\n )\n }\n})\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| dataSource | json array | -- | |\n| columns | json array | -- | |"}});
|
||||
//# sourceMappingURL=2.73d36413.chunk.js.map
|
||||
webpackJsonp([2],{109:function(n,e){n.exports="## Table \n\n\u8868\u683c\u7684\u5f62\u5f0f\u5c55\u73b0\u548c\u5904\u7406\u6570\u636e\u3002\n\n## \u4f7f\u7528\n\n```js\ndefine('my-app', class extends WeElement {\n dataSource = [{\n id: 1,\n name: 'xwang',\n age: 18,\n address: '\u817e\u8baf\u5927\u53a6'\n }, {\n id: 2,\n name: 'dntzhang',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 3,\n name: 'dntzhang2',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 4,\n name: 'dntzhang3',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }, {\n id: 5,\n name: 'dntzhang4',\n age: 12,\n address: '\u6ee8\u6d77\u5927\u53a6'\n }]\n\n columns = [{\n title: '\u59d3\u540d',\n key: 'name',\n }, {\n title: '\u5e74\u9f84',\n key: 'age',\n }, {\n title: '\u4f4f\u5740',\n key: 'address',\n }, {\n title: '\u64cd\u4f5c',\n render: (item) => (\n <span>\n <a href=\"javascript:;\" onClick={e => { this.removeItem(item) }}>Delete</a>\n </span>\n )\n }]\n\n removeItem = (item) => {\n this.table.removeItem(item)\n }\n\n render() {\n return (\n <o-table \n ref={e => { this.table = e }} \n dataSource={this.dataSource} \n columns={this.columns}>\n </o-table>\n )\n }\n})\n```\n\n## API\n\n### Props\n\n| **Name** | **Type** | **Defaults** | **Details** |\n| ------------- |:-------------:|:-----:|:-------------:|\n| dataSource | json array | -- | |\n| columns | json array | -- | |"}});
|
||||
//# sourceMappingURL=2.54a621d5.chunk.js.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["../static/js/2.73d36413.chunk.js","docs/zh-cn/table.md"],"names":["webpackJsonp","107","module","exports"],"mappings":"AAAAA,cAAc,IAERC,IACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/2.73d36413.chunk.js","sourcesContent":["webpackJsonp([2],{\n\n/***/ 107:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Table \\n\\n表格的形式展现和处理数据。\\n\\n## 使用\\n\\n```js\\ndefine('my-app', class extends WeElement {\\n dataSource = [{\\n id: 1,\\n name: 'xwang',\\n age: 18,\\n address: '腾讯大厦'\\n }, {\\n id: 2,\\n name: 'dntzhang',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 3,\\n name: 'dntzhang2',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 4,\\n name: 'dntzhang3',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 5,\\n name: 'dntzhang4',\\n age: 12,\\n address: '滨海大厦'\\n }]\\n\\n columns = [{\\n title: '姓名',\\n key: 'name',\\n }, {\\n title: '年龄',\\n key: 'age',\\n }, {\\n title: '住址',\\n key: 'address',\\n }, {\\n title: '操作',\\n render: (item) => (\\n <span>\\n <a href=\\\"javascript:;\\\" onClick={e => { this.removeItem(item) }}>Delete</a>\\n </span>\\n )\\n }]\\n\\n removeItem = (item) => {\\n this.table.removeItem(item)\\n }\\n\\n render() {\\n return (\\n <o-table \\n ref={e => { this.table = e }} \\n dataSource={this.dataSource} \\n columns={this.columns}>\\n </o-table>\\n )\\n }\\n})\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| dataSource | json array | -- | |\\n| columns | json array | -- | |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/2.73d36413.chunk.js","module.exports = \"## Table \\n\\n表格的形式展现和处理数据。\\n\\n## 使用\\n\\n```js\\ndefine('my-app', class extends WeElement {\\n dataSource = [{\\n id: 1,\\n name: 'xwang',\\n age: 18,\\n address: '腾讯大厦'\\n }, {\\n id: 2,\\n name: 'dntzhang',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 3,\\n name: 'dntzhang2',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 4,\\n name: 'dntzhang3',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 5,\\n name: 'dntzhang4',\\n age: 12,\\n address: '滨海大厦'\\n }]\\n\\n columns = [{\\n title: '姓名',\\n key: 'name',\\n }, {\\n title: '年龄',\\n key: 'age',\\n }, {\\n title: '住址',\\n key: 'address',\\n }, {\\n title: '操作',\\n render: (item) => (\\n <span>\\n <a href=\\\"javascript:;\\\" onClick={e => { this.removeItem(item) }}>Delete</a>\\n </span>\\n )\\n }]\\n\\n removeItem = (item) => {\\n this.table.removeItem(item)\\n }\\n\\n render() {\\n return (\\n <o-table \\n ref={e => { this.table = e }} \\n dataSource={this.dataSource} \\n columns={this.columns}>\\n </o-table>\\n )\\n }\\n})\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| dataSource | json array | -- | |\\n| columns | json array | -- | |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/table.md\n// module id = 107\n// module chunks = 2"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../static/js/2.54a621d5.chunk.js","docs/zh-cn/table.md"],"names":["webpackJsonp","109","module","exports"],"mappings":"AAAAA,cAAc,IAERC,IACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/2.54a621d5.chunk.js","sourcesContent":["webpackJsonp([2],{\n\n/***/ 109:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Table \\n\\n表格的形式展现和处理数据。\\n\\n## 使用\\n\\n```js\\ndefine('my-app', class extends WeElement {\\n dataSource = [{\\n id: 1,\\n name: 'xwang',\\n age: 18,\\n address: '腾讯大厦'\\n }, {\\n id: 2,\\n name: 'dntzhang',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 3,\\n name: 'dntzhang2',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 4,\\n name: 'dntzhang3',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 5,\\n name: 'dntzhang4',\\n age: 12,\\n address: '滨海大厦'\\n }]\\n\\n columns = [{\\n title: '姓名',\\n key: 'name',\\n }, {\\n title: '年龄',\\n key: 'age',\\n }, {\\n title: '住址',\\n key: 'address',\\n }, {\\n title: '操作',\\n render: (item) => (\\n <span>\\n <a href=\\\"javascript:;\\\" onClick={e => { this.removeItem(item) }}>Delete</a>\\n </span>\\n )\\n }]\\n\\n removeItem = (item) => {\\n this.table.removeItem(item)\\n }\\n\\n render() {\\n return (\\n <o-table \\n ref={e => { this.table = e }} \\n dataSource={this.dataSource} \\n columns={this.columns}>\\n </o-table>\\n )\\n }\\n})\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| dataSource | json array | -- | |\\n| columns | json array | -- | |\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/2.54a621d5.chunk.js","module.exports = \"## Table \\n\\n表格的形式展现和处理数据。\\n\\n## 使用\\n\\n```js\\ndefine('my-app', class extends WeElement {\\n dataSource = [{\\n id: 1,\\n name: 'xwang',\\n age: 18,\\n address: '腾讯大厦'\\n }, {\\n id: 2,\\n name: 'dntzhang',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 3,\\n name: 'dntzhang2',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 4,\\n name: 'dntzhang3',\\n age: 12,\\n address: '滨海大厦'\\n }, {\\n id: 5,\\n name: 'dntzhang4',\\n age: 12,\\n address: '滨海大厦'\\n }]\\n\\n columns = [{\\n title: '姓名',\\n key: 'name',\\n }, {\\n title: '年龄',\\n key: 'age',\\n }, {\\n title: '住址',\\n key: 'address',\\n }, {\\n title: '操作',\\n render: (item) => (\\n <span>\\n <a href=\\\"javascript:;\\\" onClick={e => { this.removeItem(item) }}>Delete</a>\\n </span>\\n )\\n }]\\n\\n removeItem = (item) => {\\n this.table.removeItem(item)\\n }\\n\\n render() {\\n return (\\n <o-table \\n ref={e => { this.table = e }} \\n dataSource={this.dataSource} \\n columns={this.columns}>\\n </o-table>\\n )\\n }\\n})\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| dataSource | json array | -- | |\\n| columns | json array | -- | |\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/table.md\n// module id = 109\n// module chunks = 2"],"sourceRoot":""}
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"sources":["../static/js/20.4ca2c910.chunk.js","docs/zh-cn/icon.md"],"names":["webpackJsonp","89","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/20.4ca2c910.chunk.js","sourcesContent":["webpackJsonp([20],{\n\n/***/ 89:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Icon \\n\\nSVG 制作的 Icon.\\n\\n## 使用\\n\\n```js\\n<o-icon \\n path='M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z'>\\n</o-icon>\\n```\\n\\n也可以支持多 path:\\n\\n```js\\n<o-icon paths={[{\\n color: '#F98080',\\n path: 'M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z'\\n}, {\\n color: '#F95050',\\n path: 'M464 688a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z'\\n}]} />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| paths | json array |-- | 传入 paths , path 不用传入 |\\n| path | string|-- ||\\n| scale | number | 2 | |\\n| color | bool| black ||\\n| rotate | bool| false ||\\n| isFill | bool| false |不推荐,建议用 path|\\n| type | string| -- | 不推荐,建议用 path |\\n\\n* [→ 你可以直接使用 antd 的海量 svg path 作为 icon 的 path](https://ant.design/components/icon-cn/),你可以通过开发者工具查看对应 icon 的 path\\n* [→ 也可以直接上 antd github 获取 svg path](https://github.com/ant-design/ant-design-icons/tree/master/packages/icons/svg)\\n\\n\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/20.4ca2c910.chunk.js","module.exports = \"## Icon \\n\\nSVG 制作的 Icon.\\n\\n## 使用\\n\\n```js\\n<o-icon \\n path='M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z'>\\n</o-icon>\\n```\\n\\n也可以支持多 path:\\n\\n```js\\n<o-icon paths={[{\\n color: '#F98080',\\n path: 'M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z'\\n}, {\\n color: '#F95050',\\n path: 'M464 688a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z'\\n}]} />\\n```\\n\\n## API\\n\\n### Props\\n\\n| **Name** | **Type** | **Defaults** | **Details** |\\n| ------------- |:-------------:|:-----:|:-------------:|\\n| paths | json array |-- | 传入 paths , path 不用传入 |\\n| path | string|-- ||\\n| scale | number | 2 | |\\n| color | bool| black ||\\n| rotate | bool| false ||\\n| isFill | bool| false |不推荐,建议用 path|\\n| type | string| -- | 不推荐,建议用 path |\\n\\n* [→ 你可以直接使用 antd 的海量 svg path 作为 icon 的 path](https://ant.design/components/icon-cn/),你可以通过开发者工具查看对应 icon 的 path\\n* [→ 也可以直接上 antd github 获取 svg path](https://github.com/ant-design/ant-design-icons/tree/master/packages/icons/svg)\\n\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/icon.md\n// module id = 89\n// module chunks = 20"],"sourceRoot":""}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue