导航

    Taro 社区

    Taro

    • 注册
    • 登录
    • 搜索
    • 版块
    • 最新
    • 话题
    • 热门
    • 群组
    1. 主页
    2. jd_78b92731dc70d
    J
    • 资料
    • 关注
    • 粉丝
    • 主题
    • 帖子
    • 最佳
    • 群组

    jd_78b92731dc70d

    @jd_78b92731dc70d

    0
    声望
    10
    帖子
    768
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录

    jd_78b92731dc70d 关注

    jd_78b92731dc70d 发布的帖子

    • 求taro兼职,本人是taro熟手,有需要的加微信:lyjd522

      求taro兼职,本人是taro熟手,有需要的加微信:lyjd522

      发布在 外包&私单交流
      J
      jd_78b92731dc70d
    • Render Props案例在微信小程序端无法使用

      e5e6c1a0-f312-44b4-97b5-a6f8bf122f97-image.png
      // cat.js
      import catImage from './cat.jpg'
      class Cat extends Taro.Component {
      static defaultProps = {
      mouse: {
      x: 0,
      y: 0
      }
      }

      render() {
      const { mouse } = this.props;
      return (
      <Image src={catImage} style={{ position: 'absolute', left: mouse.x, top: mouse.y }} />
      );
      }
      }

      // mouse.js
      class Mouse extends Taro.Component {
      constructor(props) {
      super(props);
      this.handleMouseMove = this.handleClick.bind(this);
      this.state = { x: 0, y: 0 };
      }

      handleClick(event) {
      const { x, y } = event.detail
      this.setState({
      x,
      y
      });
      }

      render() {
      return (
      <View style={{ height: '100%' }} onClick={this.handleClick}>

          {/*
            我们可以把 prop 当成一个函数,动态地调整渲染内容。
          */}
          {this.props.renderCat(this.state)}
        </View>
      );
      

      }
      }

      // MouseTracker.js
      class MouseTracker extends Taro.Component {
      render() {
      return (
      <View>
      <View>点击鼠标!</View>
      {/*
      Mouse 如何渲染由 MouseTracker 的状态控制
      */}
      <Mouse renderCat={mouse => (
      <Cat mouse={mouse} />
      )}/>
      </View>
      );
      }
      }

      发布在 提 Bug
      J
      jd_78b92731dc70d
    • RE: taro-ui Drawer className 无效

      自定义组件怎么可能有className

      发布在 Taro UI
      J
      jd_78b92731dc70d
    • RE: 创建的小程序没有`sitemap.json`文件, 自己添加也不会编译到小程序中,ext.json 文件自己添加也不会编译到小程序中

      配置文件里面加上2faf0959-a7d7-4f78-b857-1ca0d7d6e3aa-image.png

      发布在 微信小程序
      J
      jd_78b92731dc70d
    • taro2.0.5版本Maximum call stack size exceeded大佬们这个问题能不能解决一下 编译两次就出现 根本没法用

      a922d22f-e251-4016-923c-7b0486775548-image.png
      大佬们这个问题能不能解决一下 编译两次就出现 根本没法用
      taro2.0.5版本

      发布在 提 Bug
      J
      jd_78b92731dc70d
    • RE: Swiper,SwiperItem宽度设置的是100%

      遇到同样的问题,我这不能设置为100vw
      如何解决?

      发布在 提 Bug
      J
      jd_78b92731dc70d
    • RE: Taro-ui <AtToast/>一直被其他地方的事件重复触发显示

      建议像这样做一个封装,可以使其和全局组件差不多 调用方式为:在该页面的任何地方使用(包括组件中,不过在组件中需要在组件componentDidMount生命周期后使用)

      Taro.eventCenter.trigger('showLoading',msg)
      
      Taro.eventCenter.trigger('hideLoading')
      
      Taro.eventCenter.trigger('showSuccess',msg)
      
      Taro.eventCenter.trigger('showError',msg)
      

      import Taro, { Component } from '@tarojs/taro'
      import { AtToast } from "taro-ui"
      import { View } from '@tarojs/components'
      export default class Index extends Component {
      constructor(props) {
      super(props)
      this.showLoading = this.showLoading.bind(this)
      this.hidModal = this.hidModal.bind(this)
      this.showSuccess = this.showSuccess.bind(this)
      this.showError = this.showError.bind(this)
      this.state = {
      isOpened: false,
      type: 'success',
      text: '',
      timeVal: 2,
      icon: ''
      }
      }
      componentWillMount() {
      Taro.eventCenter.on('showLoading', this.showLoading)
      Taro.eventCenter.on('hideLoading', this.hidModal)
      Taro.eventCenter.on('showSuccess', this.showSuccess)
      Taro.eventCenter.on('showError', this.showError)
      }
      componentWillUnmount() {
      if (this.state.type === 'loading') {
      Taro.eventCenter.trigger('hideLoading')
      }
      Taro.eventCenter.off('showLoading', this.showLoading)
      Taro.eventCenter.off('hideLoading', this.hidModal)
      Taro.eventCenter.off('showSuccess', this.showSuccess)
      Taro.eventCenter.off('showError', this.showError)
      }
      showLoading(text = '加载中...', timeVal = 60) {
      this.setState({
      isOpened: true,
      type: 'loading',
      text,
      timeVal
      })
      }
      showSuccess(text = '', timeVal = 1.5) {
      this.setState({
      isOpened: true,
      type: 'success',
      text,
      timeVal
      })
      }
      showError(text = '', timeVal = 1.5) {
      this.setState({
      isOpened: true,
      type: 'error',
      text,
      timeVal
      })
      }
      hidModal() {
      this.setState({
      isOpened: false,
      })
      }
      render() {
      const { isOpened, type, text, timeVal } = this.state
      return (
      <View>
      <AtToast isOpened={isOpened} status={type} text={text} duration={timeVal * 1000} hasMask></AtToast>
      </View>
      )
      }
      }

      发布在 Taro UI
      J
      jd_78b92731dc70d
    • RE: 【求助】taro 全局弹窗调用

      不能 最少需要每个页面引用一次 但是你可以在封装成一个组件之后 使用消息订阅通知来实现和全局弹窗差不多的效果
      这样只需要在一个页面引用一次 然后页面内的任何组件任何JS都可以调用和全局组件差不多的效果

      发布在 Taro
      J
      jd_78b92731dc70d
    • RE: 「 通告 」2.0.0 beta 版本测试

      66666666666666666666666666666666

      发布在 Taro 及业界新闻
      J
      jd_78b92731dc70d