Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我该如何书写才能让原生picker组件的@change编译为bindchange #2851

Open
lihang-develop opened this issue Jun 17, 2024 · 2 comments

Comments

@lihang-develop
Copy link

@wepy/core": "^2.1.0
编译前:
WebStorm 2024-06-17 23 24 05
编译后:
image

@lihang-develop lihang-develop changed the title 我改如何书写才能让picker组件的@change编译为bindchange 我该如何书写才能让picker组件的@change编译为bindchange Jun 17, 2024
@lihang-develop lihang-develop changed the title 我该如何书写才能让picker组件的@change编译为bindchange 我该如何书写才能让原生picker组件的@change编译为bindchange Jun 17, 2024
@lihang-develop
Copy link
Author

import wepy from '@wepy/core'

wepy.page({
  props: {
  },
  data: {
    startDate: '',
    endDate: ''
  },
  methods: {
    onStartDateChange (e) {
      console.log(e.detail.value)
      console.log(2)
    },
    onEndDateChange (e) {
      console.log(e.detail.value)
      console.log(1)
    }
  },
})
`

@lihang-develop
Copy link
Author

     <picker
            mode="date"
            start="2015-09-01"
            :end="endDate"
            bindchange="onStartDateChange">
            <div class="picker-inner">
              <i class="iconfont icon-rq"></i>
              <span class="text">{{ startDate || '开始日期' }}</span>
            </div>
          </picker>
          <picker
            mode="date"
            :start="startDate"
            end="2017-09-01"
            @change="onEndDateChange">
            <div class="picker-inner">
              <i class="iconfont icon-rq"></i>
              <span class="text">{{ endDate || '结束日期' }}</span>
            </div>
          </picker>
          <picker
            mode="date"
            :start="startDate"
            end="2017-09-01"
            @bindchange="onEndDateChange">
            <div class="picker-inner">
              <i class="iconfont icon-rq"></i>
              <span class="text">{{ endDate || '结束日期' }}</span>
            </div>
          </picker>
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant