format with prettier
parent
d15067f2fe
commit
0713644961
|
|
@ -1,12 +0,0 @@
|
||||||
# http://editorconfig.org
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"printWidth": 120,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"proseWrap": "preserve",
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"jsxSingleQuote": true
|
||||||
|
}
|
||||||
|
|
@ -1,29 +1,26 @@
|
||||||
export default defineAppConfig({
|
export default defineAppConfig({
|
||||||
pages: [
|
pages: ['pages/index/index', 'pages/repair/repair', 'pages/user/user'],
|
||||||
'pages/index/index',
|
|
||||||
'pages/repair/repair',
|
|
||||||
'pages/user/user',
|
|
||||||
],
|
|
||||||
window: {
|
window: {
|
||||||
backgroundTextStyle: 'light',
|
backgroundTextStyle: 'light',
|
||||||
navigationBarBackgroundColor: '#fff',
|
navigationBarBackgroundColor: '#fff',
|
||||||
navigationBarTitleText: 'WeChat',
|
navigationBarTitleText: 'WeChat',
|
||||||
navigationBarTextStyle: 'black'
|
navigationBarTextStyle: 'black',
|
||||||
},
|
},
|
||||||
tabBar: {
|
tabBar: {
|
||||||
|
custom: true,
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
pagePath: 'pages/index/index',
|
pagePath: 'pages/index/index',
|
||||||
text: '主页'
|
text: '主页',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pagePath: 'pages/repair/repair',
|
pagePath: 'pages/repair/repair',
|
||||||
text: '维修'
|
text: '维修',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pagePath: 'pages/user/user',
|
pagePath: 'pages/user/user',
|
||||||
text: '我的'
|
text: '我的',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
|
||||||
17
src/app.ts
17
src/app.ts
|
|
@ -1,16 +1,15 @@
|
||||||
import { PropsWithChildren } from 'react'
|
import { PropsWithChildren } from 'react';
|
||||||
import { useLaunch } from '@tarojs/taro'
|
import { useLaunch } from '@tarojs/taro';
|
||||||
//import 'taro-ui/dist/style/index.scss'
|
import 'taro-ui/dist/style/index.scss';
|
||||||
import './app.scss'
|
import './app.scss';
|
||||||
|
|
||||||
function App({ children }: PropsWithChildren<any>) {
|
function App({ children }: PropsWithChildren<any>) {
|
||||||
|
|
||||||
useLaunch(() => {
|
useLaunch(() => {
|
||||||
console.log('App launched.')
|
console.log('App launched.');
|
||||||
})
|
});
|
||||||
|
|
||||||
// children 是将要会渲染的页面
|
// children 是将要会渲染的页面
|
||||||
return children
|
return children;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App
|
export default App;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: '首页',
|
navigationBarTitleText: '首页',
|
||||||
usingComponents: {}
|
usingComponents: {},
|
||||||
})
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,25 @@
|
||||||
import { View, Text } from '@tarojs/components'
|
import { View, Text } from '@tarojs/components';
|
||||||
import './index.scss'
|
import { Component, ReactNode } from 'react';
|
||||||
import { Component, ReactNode } from 'react'
|
import { AtButton } from 'taro-ui';
|
||||||
|
import './index.scss';
|
||||||
|
|
||||||
class Index extends Component {
|
class Index extends Component {
|
||||||
state = {
|
state = {
|
||||||
msg: "Hello World!"
|
msg: 'Hello World!',
|
||||||
}
|
};
|
||||||
|
|
||||||
onReady() {
|
onReady() {
|
||||||
console.log("Index is ready");
|
console.log('Index is ready');
|
||||||
}
|
}
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
|
<AtButton type='primary' size='normal'></AtButton>
|
||||||
<Text>{this.state.msg}</Text>
|
<Text>{this.state.msg}</Text>
|
||||||
</View>
|
</View>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Index
|
export default Index;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
usingComponents: {},
|
usingComponents: {},
|
||||||
})
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import { View, Text } from "@tarojs/components";
|
import { View, Text } from '@tarojs/components';
|
||||||
import { Component, ReactNode } from "react";
|
import { Component, ReactNode } from 'react';
|
||||||
|
|
||||||
export default class RepairPage extends Component {
|
export default class RepairPage extends Component {
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<Text>Repair Page</Text>
|
<Text>Repair Page</Text>
|
||||||
</View>
|
</View>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
usingComponents: {},
|
usingComponents: {},
|
||||||
})
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import { View, Text } from "@tarojs/components";
|
import { View, Text } from '@tarojs/components';
|
||||||
import { Component, ReactNode } from "react";
|
import { Component, ReactNode } from 'react';
|
||||||
|
|
||||||
export default class UserPage extends Component {
|
export default class UserPage extends Component {
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<Text>User Page</Text>
|
<Text>User Page</Text>
|
||||||
</View>
|
</View>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue