LampColorCollection 物料存在严重缺陷, 布局完全错乱

小程序开发相关产品技术讨论,包括面板、智能小程序、React Native、Ray跨端框架、Panel SDK、微信小程序、小程序开发工具(IDE)及其他开发技术相关等话题


Post Reply
MwM-Mai
Posts: 186

Code: Select all

import React, { useEffect, useState } from 'react';
import { View, Image, Text, ScrollView, router } from '@ray-js/ray';

import { LampColorCollection } from '@ray-js/components-ty-lamp';

const defaultColorList = [
  { h: 200, s: 1000, v: 1000 },
  { b: 1000, t: 670 },
];


export function Set() {

  const [colorList, setColorList] = useState(defaultColorList);
  const [activeIndex, setActiveIndex] = useState(0);
  const handleAdd = () => {
    setColorList([
      ...colorList,
      {
        b: Math.round(Math.random() * 1000),
        t: Math.round(Math.random() * 1000),
      },
    ]);
  };

  const handleDelete = (_colorList, _activeIndex) => {
    setColorList([..._colorList]);
    setActiveIndex(_activeIndex);
  };

  const handleChecked = (colorItem, _activeIndex: number) => {
    setActiveIndex(_activeIndex);
  };

  return (
    <View style={{ width: '100%', height: '100%' }}>
      <LampColorCollection
        disableDelete={colorList.length > 2}
        theme="dark"
        activeIndex={activeIndex}
        colorList={colorList}
        onAdd={handleAdd}
        onDelete={handleDelete}
        onChecked={handleChecked}
      />
    </View>
  )
}

export default Set;

Attachments
Snipaste_2025-09-12_14-46-53.png

Tags:
crisiron
Posts: 218

Re: LampColorCollection 物料存在严重缺陷, 布局完全错乱

使用的是示例代码么?放在单独页面还是弹窗中,请给出具体可复现的代码,(提供ide或 app kit 环境)示例代码无法复现

MwM-Mai
Posts: 186

Re: LampColorCollection 物料存在严重缺陷, 布局完全错乱

crisiron 2025年 Sep 12日 15:00

使用的是示例代码么?放在单独页面还是弹窗中,请给出具体可复现的代码,(提供ide或 app kit 环境)示例代码无法复现

直接复制示例代码的,上述就是我提供的可复现示例代码

Attachments
Snipaste_2025-09-12_15-32-32.png
Snipaste_2025-09-12_15-32-20.png
crisiron
Posts: 218

Re: LampColorCollection 物料存在严重缺陷, 布局完全错乱

未曾复现,可以按照图1 进行样式查看是否css加载正常,可尝试引入其他组件看看样式是否正常

企业微信截图_660cf990-b9bc-4dc8-8f7d-c7f8b9228571.png
企业微信截图_4a4bedc0-1f3f-4b66-86d2-ef35e2f961c0.png
MwM-Mai
Posts: 186

Re: LampColorCollection 物料存在严重缺陷, 布局完全错乱

crisiron 2025年 Sep 12日 15:47

未曾复现,可以按照图1 进行样式查看是否css加载正常,可尝试引入其他组件看看样式是否正常
企业微信截图660cf990-b9bc-4dc8-8f7d-c7f8b9228571.png
企业微信截图
4a4bedc0-1f3f-4b66-86d2-ef35e2f961c0.png

css加载异常,其他组件使用正常

Attachments
Snipaste_2025-09-12_15-57-39.png
Post Reply