react-taro-snippets
用JS的格式,但是智能提示响应范围包括如下
typescript
javascript
javascriptreact
typescriptreact
部分位置设置了占位符,可以初始化的时候修改及tab
切换
效果
代码片段
import React, { Component } from 'react'
import { connect } from 'react-redux'
//import * as actions from './storeModel/actionCreater'
interface Props {
}
interface State {
}
class Index extends Component <Props, State> {
constructor(props:Props){
super(props);
this.state = {
}
}
render() {
return (
<div className='component-Index'>
</div>
)
}
}
const mapState = (state) => ({
})
const mapDispatch = (dispatch) => ({
})
export default connect(mapState, mapDispatch)(Index);
import Taro , { Component } from '@tarojs/taro';
import { View, Text , Button} from '@tarojs/components';
export default class Index extends Component {
config = {
navigationBarTitleText: ''
}
state={}
componentWillMount () {}
componentDidMount () {}
componentWillReceiveProps (nextProps,nextContext) {}
componentWillUnmount () {}
componentDidShow () {}
componentDidHide () {}
componentDidCatchError () {}
componentDidNotFound () {}
render() {
return (
<View>
</View>
);
}
}
export default Index;
import { ComponentClass } from 'react'
import Taro, { Component } from '@tarojs/taro'
import { View ,Text } from '@tarojs/components'
import './Figure.less'
type PageStateProps = {}
type PageDispatchProps = {}
type PageOwnProps = {}
type PageState = {
name: string
}
type IProps = PageStateProps & PageDispatchProps & PageOwnProps
interface Figure {
props: IProps;
state: PageState
}
class Figure extends Component {
constructor(props){
super(props)
this.state = {
name: '小红'
}
}
componentWillReceiveProps (nextProps) {}
componentWillUnmount () { }
componentDidShow () { }
componentDidHide () { }
render () {
return (
<View className='Figure'>
<Text>hello world</Text>
</View>
)
}
}
export default Figure as ComponentClass<PageOwnProps, PageState>
import Taro , { PureComponent } from '@tarojs/taro';
import { View, Text , Button} from '@tarojs/components';
class Index extends PureComponent {
config = {
navigationBarTitleText: ''
}
state={}
componentWillMount () {}
componentDidMount () {}
componentWillReceiveProps (nextProps,nextContext) {}
componentWillUnmount () {}
componentDidShow () {}
componentDidHide () {}
componentDidCatchError () {}
componentDidNotFound () {}
render() {
return (
<View>
</View>
);
}
}
export default Index;
config = {
pages: [
'pages/index/index'
],
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black'
}
}
import {} from '@tarojs/mobx'
import {} from '@tarojs/redux'
import {} from '$tarojs/'
import { connect } from '@tarojs/redux'
import {inject, observer} from '@tarojs/mobx'
import { action, observable, computed, toJS } from 'mobx'
其他
有问题的小伙伴可以提交 Issues
PR