We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.1.6
vue2.5.x any OS
https://tangjinzhou.gitee.io/ant-design-vue/components/tree-cn/#components-tree-demo-directory
https://tangjinzhou.gitee.io/ant-design-vue/components/tree-cn/#components-tree-demo-directory 自定义图标 # 可以针对不同的节点定制图标。 ==> 这个selected 出来有问题,在官网上就不能根据点击状态进行图标切换
<template slot="custom" slot-scope="{selected}"> <a-icon :type="selected ? 'frown':'frown-o'" /> </template>
<template slot="custom" slot-scope="{selected}">
<a-icon :type="selected ? 'frown':'frown-o'" />
</template>
frown到frown-o的切换, 应该能够根据selected 起作用
看了一下是antd.js renderSelector调用生成自定义函数里面ref指向的是渲染函数,而非当前的item
fn: function(ref) { //<== 这个函数实际上会被renderSelector压入两个参数func 和item
//var item =arguments[1]; 实际操作的对象在第二个参数,但是ref指向的是func, 应该指向item就对了
return [_vm._v( _c('a-icon', { attrs: {"type": ref.selected ? 'frown' : 'frown-o'}})] }
改成 <template slot="custom" slot-scope="ref,slotProps"> <a-icon :type="slotProps.selected ? 'frown':'frown-o'" /> </template>
<template slot="custom" slot-scope="ref,slotProps">
<a-icon :type="slotProps.selected ? 'frown':'frown-o'" />
可work
The text was updated successfully, but these errors were encountered:
下个版本会修复参数顺序错误问题 感谢反馈
Sorry, something went wrong.
fix: tree custom icon auguments error #223
9638e01
@tangjinzhou 这问题官网又出现了
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
Version
1.1.6
Environment
vue2.5.x any OS
Reproduction link
https://tangjinzhou.gitee.io/ant-design-vue/components/tree-cn/#components-tree-demo-directory
Steps to reproduce
https://tangjinzhou.gitee.io/ant-design-vue/components/tree-cn/#components-tree-demo-directory
自定义图标 # 可以针对不同的节点定制图标。 ==> 这个selected 出来有问题,在官网上就不能根据点击状态进行图标切换
What is expected?
<template slot="custom" slot-scope="{selected}">
<a-icon :type="selected ? 'frown':'frown-o'" />
</template>
frown到frown-o的切换, 应该能够根据selected 起作用
What is actually happening?
看了一下是antd.js renderSelector调用生成自定义函数里面ref指向的是渲染函数,而非当前的item
fn: function(ref) { //<== 这个函数实际上会被renderSelector压入两个参数func 和item
//var item =arguments[1]; 实际操作的对象在第二个参数,但是ref指向的是func, 应该指向item就对了
return [_vm._v( _c('a-icon', { attrs: {"type": ref.selected ? 'frown' : 'frown-o'}})]
}
改成
<template slot="custom" slot-scope="ref,slotProps">
<a-icon :type="slotProps.selected ? 'frown':'frown-o'" />
</template>
可work
The text was updated successfully, but these errors were encountered: