feat: init

This commit is contained in:
eric
2022-11-12 14:46:03 +02:00
parent d3ae469a7d
commit fa3b76de1f
16 changed files with 358 additions and 0 deletions

11
src/app.config.ts Normal file
View File

@@ -0,0 +1,11 @@
export default defineAppConfig({
pages: [
'pages/index/index'
],
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black'
}
})

0
src/app.less Normal file
View File

18
src/app.ts Normal file
View File

@@ -0,0 +1,18 @@
import { Component, PropsWithChildren } from 'react'
import './app.less'
class App extends Component<PropsWithChildren> {
componentDidMount () {}
componentDidShow () {}
componentDidHide () {}
render () {
// this.props.children 是将要会渲染的页面
return this.props.children
}
}
export default App

17
src/index.html Normal file
View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="format-detection" content="telephone=no,address=no">
<meta name="apple-mobile-web-app-status-bar-style" content="white">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
<title>myApp</title>
<script><%= htmlWebpackPlugin.options.script %></script>
</head>
<body>
<div id="app"></div>
</body>
</html>

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '首页'
})

View File

24
src/pages/index/index.tsx Normal file
View File

@@ -0,0 +1,24 @@
import { Component, PropsWithChildren } from 'react'
import { View, Text } from '@tarojs/components'
import './index.less'
export default class Index extends Component<PropsWithChildren> {
componentWillMount () { }
componentDidMount () { }
componentWillUnmount () { }
componentDidShow () { }
componentDidHide () { }
render () {
return (
<View className='index'>
<Text>Hello world!</Text>
</View>
)
}
}