-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
8,097 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script lang="ts" src="./app.ts"></script> | ||
|
||
<style lang="stylus"> | ||
.page | ||
height 100% | ||
|
||
::-webkit-scrollbar { | ||
width: 0; | ||
background: transparent; | ||
} | ||
</style> | ||
|
||
<script type="application/json"> | ||
{ | ||
"pages": [ | ||
"./pages/index", | ||
"./pages/button/index", | ||
"./pages/button-group/index" | ||
] | ||
} | ||
</script> | ||
|
||
<!--也可以通过以下形式用js输出json,便于书写注释和使用条件编译--> | ||
|
||
<!--<script name="json">--> | ||
<!-- // 可以写注释,通过defs注入的常量做一些判断之类的操作--> | ||
<!-- module.exports = {--> | ||
<!-- pages: [--> | ||
<!-- './pages/index'--> | ||
<!-- ]--> | ||
<!-- }--> | ||
<!--</script>--> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import mpx, { createApp } from '@mpxjs/core' | ||
import apiProxy from '@mpxjs/api-proxy' | ||
|
||
mpx.use(apiProxy, { usePromise: true }) | ||
|
||
// app.js | ||
createApp({}) | ||
|
||
const isIframe = __mpx_mode__ === 'web' && window.parent !== window | ||
|
||
if (isIframe) { | ||
let prevPath = '' | ||
const handleMessage = (e) => { | ||
const { to } = (typeof e.data === 'object' ? e.data : {}) as any | ||
if (to !== undefined && to !== prevPath) { | ||
mpx.redirectTo({ | ||
url: `/pages/${to && to !== 'intro' ? `${to}/` : ''}index` | ||
}) | ||
prevPath = to | ||
} | ||
} | ||
window.addEventListener('message', handleMessage) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"modules": false, | ||
"shippedProposals": true | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
[ | ||
"@babel/transform-runtime", | ||
{ | ||
"corejs": 3, | ||
"version": "^7.10.4" | ||
} | ||
], | ||
"@mpxjs/babel-plugin-inject-page-events" | ||
], | ||
"sourceType": "unambiguous", | ||
"env": { | ||
"test": { | ||
"presets": [ | ||
[ | ||
"@babel/env", | ||
{ | ||
"shippedProposals": true | ||
} | ||
] | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default { | ||
'entryMap': { | ||
introduce: [ | ||
{ | ||
name: '基础', | ||
components: [ | ||
'button', | ||
'button-group' | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<template> | ||
<view class="base-container" wx:style="{{ style }}"> | ||
<slot></slot> | ||
</view> | ||
</template> | ||
|
||
<script> | ||
import { createComponent } from '@mpxjs/core' | ||
|
||
const isIframe = __mpx_mode__ === 'web' && window.parent !== window | ||
|
||
createComponent({ | ||
options: { | ||
addGlobalClass: true, | ||
styleIsolation: 'shared' | ||
}, | ||
data: { | ||
style: !isIframe ? { | ||
height: 'auto', | ||
minHeight: '100%', | ||
overflow: 'unset' | ||
} : {} | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="stylus"> | ||
view.base-container, | ||
div.base-container | ||
background-color #f7f8fa | ||
.base-container | ||
width 100% | ||
height 100% | ||
padding 20px | ||
box-sizing border-box | ||
overflow auto | ||
-webkit-overflow-scrolling touch | ||
&::after | ||
display block | ||
content ' ' | ||
width 100% | ||
height 1px | ||
background-color transparent | ||
</style> | ||
|
||
<script type="application/json"> | ||
{ | ||
"styleIsolation": "shared", | ||
"component": true, | ||
"usingComponents": {} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<template> | ||
<view class="desc"> | ||
<slot></slot> | ||
</view> | ||
</template> | ||
|
||
<script> | ||
import { createComponent } from '@mpxjs/core' | ||
|
||
createComponent({ | ||
options: { | ||
addGlobalClass: true, | ||
styleIsolation: 'shared' | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="stylus"> | ||
.desc | ||
font-size 12px | ||
color #4B4B4D | ||
line-height 18px | ||
margin-bottom 15px | ||
</style> | ||
|
||
<script type="application/json"> | ||
{ | ||
"styleIsolation": "shared", | ||
"component": true | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,56 @@ | ||
{ | ||
"name": "demo", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node index", | ||
"docs": "vitepress dev docs", | ||
"gen-doc": "vuese-website" | ||
"gen-doc": "vuese-website", | ||
"build:ali": "mpx-cli-service build --targets=ali", | ||
"build:dd": "mpx-cli-service build --targets=dd", | ||
"build:mp": "mpx-cli-service build", | ||
"build:mp:dev": "mpx-cli-service build --mode=development", | ||
"build:web": "mpx-cli-service build --targets=web", | ||
"inspect:mp": "mpx-cli-service inspect > output.js", | ||
"inspect:web": "mpx-cli-service inspect --targets=web > output.js", | ||
"watch:mp": "mpx-cli-service serve", | ||
"watch:ali": "mpx-cli-service serve --targets=ali", | ||
"watch:web": "mpx-cli-service serve --targets=web" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged", | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
}, | ||
"browserslist": "ios >= 8, chrome >= 47", | ||
"dependencies": { | ||
"@babel/core": "^7.10.4", | ||
"@babel/plugin-transform-runtime": "^7.10.4", | ||
"@babel/plugin-transform-typescript": "^7.20.0", | ||
"@babel/preset-env": "^7.10.4", | ||
"@babel/runtime-corejs3": "^7.10.4", | ||
"@mpxjs/api-proxy": "2.9.21", | ||
"@mpxjs/babel-plugin-inject-page-events": "^2.9.0", | ||
"@mpxjs/core": "2.9.21", | ||
"@mpxjs/mpx-cli-service": "^2.1.5", | ||
"@mpxjs/mpx-cube-ui": "^1.0.3", | ||
"@mpxjs/store": "^2.9.0", | ||
"@mpxjs/vue-cli-plugin-mpx": "^2.1.5", | ||
"@mpxjs/vue-cli-plugin-mpx-theme": "2.0.0-beta.2", | ||
"@mpxjs/vue-cli-plugin-mpx-typescript": "^2.1.5", | ||
"@mpxjs/vuese-website": "file:../packages/website", | ||
"vitepress": "^1.2.3" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
"@mpxjs/webpack-plugin": "2.9.17", | ||
"@vue/cli-service": "~5.0.8", | ||
"postcss-css-variables": "^0.19.0", | ||
"stylus": "^0.55.0", | ||
"stylus-loader": "^6.1.0", | ||
"typescript": "^4.9.5", | ||
"vitepress": "^1.2.3", | ||
"vue": "^2.6.14", | ||
"vue-demi": "^0.13.11", | ||
"vue-i18n": "^8.27.2", | ||
"vue-i18n-bridge": "^9.2.2", | ||
"vue-router": "^3.6.5", | ||
"webpack": "^5.48.0" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.