leafer-ui icon indicating copy to clipboard operation
leafer-ui copied to clipboard

创建文字元素后再去设置boxstyle的fill属性有概率会不显示

Open kekesita opened this issue 4 months ago • 2 comments

官网上的playground可直接使用以下代码复现

// #创建 Text [带背景框样式 (Leafer)]
import { Leafer, Text } from 'leafer-ui'
import '@leafer-in/state' // 导入交互状态插件 
import '@leafer-in/animate' // 导入动画插件  

const leafer = new Leafer({ view: window })

const text = new Text({
    id:"bock",
    fill: 'black',
    text: 'Welcome to LeaferJS',
    editable:true,
    fontSize:100,
    padding: 10,
    
    // boxStyle: { // 设置背景框样式 
    //     fill: '#32cd79',
    //     stroke: 'black',  //创建时存在这个配置就会生效
    //     cornerRadius: 60
    // },\
 
   
})

leafer.add(text)
setTimeout(()=>{
    //这样设置无法生效  
    leafer.findOne('#bock').set({'boxStyle':{fill:{color:'#000',type:'solid'}}});

    //如果只设置颜色也是会生效
    //leafer.findOne('#bock').set({'boxStyle':{fill:'#000'}});
},2000)

kekesita avatar Sep 01 '25 08:09 kekesita

收到,谢谢反馈~

leaferjs avatar Sep 01 '25 23:09 leaferjs

已修复,等待新版本发布

leaferjs avatar Sep 02 '25 00:09 leaferjs