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

[ColorPicker] 颜色选择器 遍历循环的时候无法监听change 事件会报错 #634

Closed
dennlian opened this issue Apr 21, 2022 · 2 comments
Labels
🏃 in progress someone is developing

Comments

@dennlian
Copy link

dennlian commented Apr 21, 2022

tdesign-vue-next 版本

0.10.2

重现链接

https://tdesign.tencent.com/vue-next/components/color-picker?tab=demo

重现步骤

<template>
  <div class="tdesign-demo-block-row">
    <div class="item">
      <h5>默认(单色 + 线性渐变)</h5>
      <t-color-picker v-model="color1" format="CSS" />
    </div>
    <div class="item">
      <h5>仅单色模式</h5>
      <t-color-picker
        v-model="color2"
        format="CSS"
        :color-modes="['monochrome']"
      />
    </div>
    <div style="width: 100%"></div>
    <div class="item">
      <h5>仅线性渐变模式</h5>
      <t-color-picker
        v-model="color3"
        format="CSS"
        :color-modes="['linear-gradient']"
      />
    </div>

    <div class="item" v-for="(it, idx) in list" :key="idx">
      <h5>默认(单色 + 线性渐变)</h5>
      <t-color-picker v-model="it.color" @change="change" format="CSS" />
    </div>
  </div>
</template>
<script setup>
import { ref } from 'vue';

const color1 = ref('#0052d9');
const color2 = ref('#0052d9');
const color3 = ref('linear-gradient(45deg, #4facfe 0%, #00f2fe 100%)');

const list = ref([{ color: '#F00' }]);
const change = (value) => {
  console.log(value);
};
</script>
<style scoped>
.item {
  display: inline-block;
  vertical-align: middle;
  margin-right: 20px;
}
.item h5 {
  font-weight: normal;
  margin-bottom: 10px;
}
</style>

期望结果

遍历的时候不报错,可以触发变化事件

实际结果

image

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

@github-actions
Copy link
Contributor

👋 @dennlian,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@PengYYYYY PengYYYYY added the 🏃 in progress someone is developing label Apr 23, 2022
@PengYYYYY
Copy link
Collaborator

PengYYYYY commented Apr 23, 2022

S-mohan 处理中

S-mohan added a commit to S-mohan/tdesign-vue-next that referenced this issue May 10, 2022
@S-mohan S-mohan mentioned this issue May 10, 2022
16 tasks
@uyarn uyarn closed this as completed in 53e8402 May 10, 2022
PengYYYYY pushed a commit that referenced this issue May 20, 2022
* feat(color-picker): 新增渐变预览, 新增最近使用颜色添加操作

* feat(color-picker): 新增渐变预览, 改进增加最近使用色交互

* style(color-picker): 抽离公共逻辑文件

* fix(color-picker): color-picker, 子目录增加style相关代码

* fix(color-picker): fix: #634

fix #634

* style(color-picker): 删除demo文件中测试demo

* test(color-picker): update test files

* feat(color-picker): 使用common中的常量, 删除无用的代码, 样式BEM
PengYYYYY pushed a commit that referenced this issue May 27, 2022
* feat(color-picker): 新增渐变预览, 新增最近使用颜色添加操作

* feat(color-picker): 新增渐变预览, 改进增加最近使用色交互

* style(color-picker): 抽离公共逻辑文件

* fix(color-picker): color-picker, 子目录增加style相关代码

* fix(color-picker): fix: #634

fix #634

* style(color-picker): 删除demo文件中测试demo

* test(color-picker): update test files

* feat(color-picker): 使用common中的常量, 删除无用的代码, 样式BEM

* test: update test file

closed #878

* test: update test file

closed #878
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏃 in progress someone is developing
Projects
None yet
Development

No branches or pull requests

2 participants