Skip to content

Commit dd5024d

Browse files
committed
🎉 Initial update
1 parent fe9ab59 commit dd5024d

File tree

24 files changed

+557
-292
lines changed

24 files changed

+557
-292
lines changed

babel.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
module.exports = function(api) {
22
api.cache(true)
33
return {
4-
presets: [
5-
'@babel/preset-typescript'
6-
],
4+
presets: ['@babel/preset-typescript'],
75
plugins: ['@babel/plugin-transform-modules-commonjs', '@babel/plugin-transform-typescript'],
86
babelrcRoots: ['.', 'node_modules']
97
}

scripts/selfCloseInputTag.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @file: selfCloseInputTag.js
3+
* @desc: 遍历指定目录下 .ux 文件,将其中 input 标签由 <input **></input> 转换为 <input ** />
4+
* @date: 2019-01-23
5+
*/
6+
7+
const fs = require('fs')
8+
const path = require('path')
9+
10+
const quickappCodePath = './src/'
11+
12+
const main = codePath => {
13+
const traversing = cpath => {
14+
const files = fs.readdirSync(cpath)
15+
files.forEach(fileName => {
16+
const fPath = path.join(cpath, fileName)
17+
const stats = fs.statSync(fPath)
18+
stats.isDirectory() && traversing(fPath)
19+
stats.isFile() && fPath.endsWith('.ux') && matchAndReplace(fPath)
20+
})
21+
}
22+
traversing(codePath)
23+
}
24+
25+
const matchAndReplace = path => {
26+
const pageContent = fs.readFileSync(path, 'UTF-8')
27+
const newContent = pageContent.replace(/(<)([\s]*?)(input\b[^\/]*?)>[\s\S]*?<\/input>/gm, '$1$3 />')
28+
fs.writeFile(path, newContent, error => {
29+
if (error) throw `Something went wrong: ${error}`
30+
})
31+
}
32+
33+
main(quickappCodePath)

src/About/index.ux

Lines changed: 0 additions & 164 deletions
This file was deleted.

src/Demo/index.ux

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/Demo/util.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/app.ux

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
<script>
2-
/**
3-
* @file 应用级别的配置,供所有页面公用
4-
*/
2+
/**
3+
* @file 应用级别的配置,供所有页面公用
4+
*/
55

6-
import './global'
7-
import util from './util'
6+
import { setGlobalData, getGlobalData } from './global'
7+
import { $utils, $apis, $ajax } from './helper'
88

9-
export default {
10-
showMenu: util.showMenu,
11-
createShortcut: util.createShortcut
12-
}
13-
</script>
9+
setGlobalData('$utils', $utils)
10+
setGlobalData('$apis', $apis)
11+
setGlobalData('$ajax', $ajax)
12+
13+
export default {
14+
showMenu: $utils.showMenu,
15+
createShortcut: $utils.createShortcut
16+
}
17+
</script>

src/assets/styles/common.less

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.page-wrapper {
2+
font-size: 5 * @size-factor;
3+
}
4+
.wrapper-padding {
5+
padding: 0 5 * @size-factor;
6+
}
7+
8+
.title {
9+
color: #212121;
10+
font-size: 6 * @size-factor;
11+
font-weight: bold;
12+
text-align: center;
13+
margin-top: 5 * @size-factor;
14+
}
15+
.desc {
16+
color: #454545;
17+
margin-top: 4 * @size-factor;
18+
font-size: 4.5 * @size-factor;
19+
// background-image: url('./../images/logo.png');
20+
background-size: cover;
21+
background-repeat: repeat;
22+
}
23+
.button {
24+
border: 1px solid @brand;
25+
background-color: #ffffff;
26+
padding: 2 * @size-factor 4 * @size-factor;
27+
color: @brand;
28+
font-size: 4.5 * @size-factor;
29+
border-radius: 40px;
30+
margin-top: 6 * @size-factor;
31+
margin-bottom: 6 * @size-factor;
32+
}

src/assets/styles/mixins.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.flex-box-mixins (@column, @justify, @align) {
2+
flex-direction: @column;
3+
justify-content: @justify;
4+
align-items: @align;
5+
}

src/assets/styles/style.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@import './variables.less';
2+
@import './mixins.less';
3+
@import './common.less';

0 commit comments

Comments
 (0)