vantui icon indicating copy to clipboard operation
vantui copied to clipboard

Rate组件设置半星显示异常

Open liujunminx opened this issue 1 year ago • 3 comments

这个 Issue 涉及以下平台:

  • [x] 微信小程序
  • [ ] 支付宝小程序
  • [ ] 百度小程序
  • [ ] 头条小程序
  • [ ] 快手小程序
  • [ ] QQ 轻应用
  • [ ] Web 平台(H5)

BUG 描述 Rate组件设置半星显示异常 复现步骤 加入allowHalf

<Rate allowHalf value={scoreServer} onChange={(e) => this.setState({scoreServer: e.detail})}/>

期望结果

实际结果 半星显示在正常全星后面 截图 image

环境

"dependencies": {
  "@antmjs/vantui": "^2.5.3",
  "@babel/runtime": "^7.7.7",
  "@tarojs/components": "3.6.2",
  "@tarojs/plugin-framework-react": "3.6.2",
  "@tarojs/plugin-sass": "^2.2.10",
  "@tarojs/react": "3.6.2",
  "@tarojs/runtime": "3.6.2",
  "@tarojs/taro": "3.6.2",
  "@vant/area-data": "^1.4.1",
  "dva-core": "^2.0.4",
  "dva-immer": "^0.5.2",
  "jsencrypt": "^3.3.1",
  "react": "^17.0.0",
  "react-dom": "^17.0.0",
  "react-redux": "^7.2.0",
  "redux": "^4.0.0",
  "redux-logger": "^3.0.6",
  "redux-thunk": "^2.3.0",
  "taro-ui": "^3.0.0-alpha.9",
  "weapp-qrcode": "^1.0.0",
  "xlsx": "^0.18.5"
}
npm: 8.19.4
node: v16.20.0

附加信息

liujunminx avatar Dec 11 '23 03:12 liujunminx

/* eslint-disable */
import react from 'react'
import { Rate } from '@antmjs/vantui'

export default function Demo() {
  const [value, setValue] = react.useState(4.5)

  return (
    <Rate
      value={value}
      allowHalf
      voidIcon="star"
      voidColor="#eee"
      onChange={(e) => setValue(e.detail)}
    />
  )
}

zuolung avatar Dec 21 '23 06:12 zuolung

未复现

zuolung avatar Dec 21 '23 06:12 zuolung

可能是环境哪里有问题,我这环境配的挺乱的,原有的node_modules都删不了,删了重新yarn install然后运行会报

Module not found: Error: Can't resolve '@antmjs/vantui/es/power-scroll-view/style/less' in 'D:\Project\xxx'
resolve '@antmjs/vantui/es/power-scroll-view/style/less' in 'D:\Project\xxx'
Parsed request is a module
using description file: D:\Project\xxx)
resolve as module
D:\Project\xxx\node_modules doesn't exist or is not a directory

liujunminx avatar Dec 25 '23 03:12 liujunminx