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

Calendar 底部确认按钮样式错位 #2909

Open
coderlfm opened this issue Jan 1, 2025 · 0 comments
Open

Calendar 底部确认按钮样式错位 #2909

coderlfm opened this issue Jan 1, 2025 · 0 comments
Assignees

Comments

@coderlfm
Copy link

coderlfm commented Jan 1, 2025

NutUI React 包名

@nutui/nutui-react-taro

NutUI React 版本号

3.0.0-beta.10

平台

weapp

重现链接

1

重现步骤

import React, { useState } from 'react'
import { Cell, Calendar } from '@nutui/nutui-react-taro'
import { Star } from '@nutui/icons-react-taro'

const Demo1 = () => {
  const d = new Date()
  const currDay = `${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`
  const [date, setDate] = useState(currDay)
  const [isVisible, setIsVisible] = useState(false)
  const [dateWeek, setDateWeek] = useState('')

  const openSwitch = () => {
    setIsVisible(true)
  }

  const closeSwitch = () => {
    setIsVisible(false)
  }

  const setChooseValue = (param: string) => {
    setDate(param[3])
    setDateWeek(param[4])
  }

  const select = (param: string) => {
    console.log(param)
  }

  return (
    <>
      <Cell
        title="选择单个日期"
        description={date ? `${date} ${dateWeek}` : '请选择'}
        onClick={openSwitch}
      />
      <Calendar
        visible={isVisible}
        showTitle={false}
        defaultValue={date}
        onClose={closeSwitch}
        onConfirm={setChooseValue}
        onDayClick={select}
        closeIcon={<Star />}
      />
    </>
  )
}
export default Demo1

期望的结果是什么?

样式正常

实际的结果是什么?

样式错位
image
image

环境信息

No response

其他补充信息

No response

@xiaoyatong xiaoyatong self-assigned this Jan 13, 2025
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

2 participants