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({
|
||||
pages: [
|
||||
'pages/index/index',
|
||||
'pages/repair/repair',
|
||||
'pages/user/user',
|
||||
],
|
||||
pages: ['pages/index/index', 'pages/repair/repair', 'pages/user/user'],
|
||||
window: {
|
||||
backgroundTextStyle: 'light',
|
||||
navigationBarBackgroundColor: '#fff',
|
||||
navigationBarTitleText: 'WeChat',
|
||||
navigationBarTextStyle: 'black'
|
||||
navigationBarTextStyle: 'black',
|
||||
},
|
||||
tabBar: {
|
||||
custom: true,
|
||||
list: [
|
||||
{
|
||||
pagePath: 'pages/index/index',
|
||||
text: '主页'
|
||||
text: '主页',
|
||||
},
|
||||
{
|
||||
pagePath: 'pages/repair/repair',
|
||||
text: '维修'
|
||||
text: '维修',
|
||||
},
|
||||
{
|
||||
pagePath: 'pages/user/user',
|
||||
text: '我的'
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
text: '我的',
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
|
|
|||
17
src/app.ts
17
src/app.ts
|
|
@ -1,16 +1,15 @@
|
|||
import { PropsWithChildren } from 'react'
|
||||
import { useLaunch } from '@tarojs/taro'
|
||||
//import 'taro-ui/dist/style/index.scss'
|
||||
import './app.scss'
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { useLaunch } from '@tarojs/taro';
|
||||
import 'taro-ui/dist/style/index.scss';
|
||||
import './app.scss';
|
||||
|
||||
function App({ children }: PropsWithChildren<any>) {
|
||||
|
||||
useLaunch(() => {
|
||||
console.log('App launched.')
|
||||
})
|
||||
console.log('App launched.');
|
||||
});
|
||||
|
||||
// children 是将要会渲染的页面
|
||||
return children
|
||||
return children;
|
||||
}
|
||||
|
||||
export default App
|
||||
export default App;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export default definePageConfig({
|
||||
navigationBarTitleText: '首页',
|
||||
usingComponents: {}
|
||||
})
|
||||
usingComponents: {},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,23 +1,25 @@
|
|||
import { View, Text } from '@tarojs/components'
|
||||
import './index.scss'
|
||||
import { Component, ReactNode } from 'react'
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import { Component, ReactNode } from 'react';
|
||||
import { AtButton } from 'taro-ui';
|
||||
import './index.scss';
|
||||
|
||||
class Index extends Component {
|
||||
state = {
|
||||
msg: "Hello World!"
|
||||
}
|
||||
msg: 'Hello World!',
|
||||
};
|
||||
|
||||
onReady() {
|
||||
console.log("Index is ready");
|
||||
console.log('Index is ready');
|
||||
}
|
||||
|
||||
render(): ReactNode {
|
||||
return (
|
||||
<View>
|
||||
<AtButton type='primary' size='normal'></AtButton>
|
||||
<Text>{this.state.msg}</Text>
|
||||
</View>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index
|
||||
export default Index;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
export default definePageConfig({
|
||||
usingComponents: {},
|
||||
})
|
||||
usingComponents: {},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { View, Text } from "@tarojs/components";
|
||||
import { Component, ReactNode } from "react";
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import { Component, ReactNode } from 'react';
|
||||
|
||||
export default class RepairPage extends Component {
|
||||
render(): ReactNode {
|
||||
return (
|
||||
<View>
|
||||
<Text>Repair Page</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
render(): ReactNode {
|
||||
return (
|
||||
<View>
|
||||
<Text>Repair Page</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
export default definePageConfig({
|
||||
usingComponents: {},
|
||||
})
|
||||
usingComponents: {},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { View, Text } from "@tarojs/components";
|
||||
import { Component, ReactNode } from "react";
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import { Component, ReactNode } from 'react';
|
||||
|
||||
export default class UserPage extends Component {
|
||||
render(): ReactNode {
|
||||
return (
|
||||
<View>
|
||||
<Text>User Page</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
render(): ReactNode {
|
||||
return (
|
||||
<View>
|
||||
<Text>User Page</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue