VSCode-taro-snippets
为了少敲重复代码,节约时间,这个东东就出来了;
用JS的格式,但是智能提示响应范围包括如下
typescript
javascript
javascriptreact
typescriptreact
部分位置设置了占位符,可以初始化的时候修改及tab
切换
效果
代码片段
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 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'
其他
没有做专门的ts
版本,有兴趣的小伙伴可以提交PR