leafer-ui
leafer-ui copied to clipboard
创建文字元素后再去设置boxstyle的fill属性有概率会不显示
官网上的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)
收到,谢谢反馈~
已修复,等待新版本发布