当前位置:   article > 正文

taro + iview 实现跨平台开发(App,Wap,微信小程序)

tarojs 使用iview

1.安装

(1)安装脚手架

  1. npm install -g @tarojs/cli
  2. taro init myApp

(2)H5端运行

  1. npm run dev:h5
  2. taro build --type h5 --watch

(3)微信小程序端运行

  1. npm run dev:weapp
  2. taro build --type weapp --watch

2.语法

  1. import Taro, { Component } from '@tarojs/taro'
  2. import Index from './pages/index'
  3. import './app.scss'
  4. class App extends Component {
  5. // 项目配置
  6. config = {
  7. pages: [
  8. 'pages/index/index'
  9. ],
  10. window: {
  11. backgroundTextStyle: 'light',
  12. navigationBarBackgroundColor: '#fff',
  13. navigationBarTitleText: 'WeChat',
  14. navigationBarTextStyle: 'black'
  15. }
  16. }
  17. componentWillMount () {}
  18. componentDidMount () {}
  19. componentDidShow () {}
  20. componentDidHide () {}
  21. render () {
  22. return (
  23. <Index />
  24. )
  25. }
  26. }

3.demo

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/759281
推荐阅读
相关标签
  

闽ICP备14008679号