format with prettier

yhy
FrozenArcher 2024-03-04 00:00:33 +08:00
parent d15067f2fe
commit 0713644961
10 changed files with 65 additions and 68 deletions

View File

@ -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

11
.prettierrc 100644
View File

@ -0,0 +1,11 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"proseWrap": "preserve",
"arrowParens": "avoid",
"bracketSpacing": true,
"jsxSingleQuote": true
}

View File

@ -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: '我的',
},
],
},
});

View File

@ -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;

View File

@ -1,4 +1,4 @@
export default definePageConfig({
navigationBarTitleText: '首页',
usingComponents: {}
})
usingComponents: {},
});

View File

@ -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;

View File

@ -1,3 +1,3 @@
export default definePageConfig({
usingComponents: {},
})
usingComponents: {},
});

View File

@ -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>
);
}
}

View File

@ -1,3 +1,3 @@
export default definePageConfig({
usingComponents: {},
})
usingComponents: {},
});

View File

@ -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>
);
}
}