HarmonyOS/OpenHarmony application development-API version 9 inheritance style

Description: API version 9 starts to support

 

You can inherit the style of the parent component by setting the inherit-class property.

Custom components have an inherit-class attribute, defined as follows:

name

type

Defaults

required

describe

inherit-class

string

-

no

The class style inherited from the parent component, multiple class styles are separated by spaces.

Sample code:

 

 

 

 

Example effect:

 

Guess you like

Origin blog.csdn.net/weixin_69135651/article/details/129724345