简体中文
Appearance
修改元素属性(静态方法),一般用来修改默认值
string
IValue
修改元素属性的默认值 (全局操作)。
后续创建的所有文本,默认填充色都将变为红色, 但不会影响其他类型的元素。
// #修改元素属性 [修改文本默认填充色为红色] import { Leafer, Text } from 'leafer-ui' const leafer = new Leafer({ view: window }) Text.changeAttr('fill', 'red') const text = new Text({ text: 'Welcome to LeaferJS' }) leafer.add(text)