简体   繁体   中英

Dynamically change the Column size on ionic

I am trying to dynamically change the Column size

<ion-col [size]="this.size" [size-xl]="this.size_xl" [size-md]="this.size_md" [size-sm]="this.size_sm" [size-xs]="this.size_xs">

but this error appears

NG0303: Can't bind to 'size-xl' since it isn't a known property of 'ion-col'.

NOTE

its just working on [size]=“this.size”

You can do something like:

<ion-col [size]="size" [attr.size-xl]="size_xl" [attr.size-md]="size_md" [attr.size-sm]="size_sm" [attr.size-xs]="size_xs">

Although there's probably no need to define all the sizes, you can probably just define a single place for logic that'll handle the default size attribute.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM