英文:
How to move icon in primeng accordion from left to right?
问题
我想使用PrimeNg的手风琴,并希望折叠图标位于右侧,而不是左侧。我尝试操作iconPos属性,但无法使其对我起作用。有人能在这里给我建议吗?
<p-accordion [multiple]="true" [iconPos]="endVal">
<p-accordionTab header="标题1">
内容1
</p-accordionTab>
<p-accordionTab header="标题2">
内容2
</p-accordionTab>
<p-accordionTab header="标题3">
内容3
</p-accordionTab>
</p-accordion>
英文:
I want to use an accordion from PrimeNg and I want collapse icon to be on the right side, not left. I tried to manipulate the iconPos attribute, but I cannot make it working for me. Can someone advise me here?
<p-accordion [multiple]="true" [iconPos]="endVal"> // endVal comes from ts and gets "end"
<p-accordionTab header="Header 1">
Content 1
</p-accordionTab>
<p-accordionTab header="Header 2">
Content 2
</p-accordionTab>
<p-accordionTab header="Header 3">
Content 3
</p-accordionTab>
</p-accordion>
答案1
得分: 1
iconPos
参数在PrimeNG 15.1.0中引入,请确保您至少运行此版本。
此外,由于这是您StackBlitz中的问题,请确保将参数绑定到属性,而不是字符串'endVal':
<!-- 在您的StackBlitz中 -->
<p-accordionTab header="Header I" [selected]="true" iconPos="endVal">
<!-- 应该是 -->
<p-accordionTab header="Header I" [selected]="true" [iconPos]="endVal">
英文:
The iconPos
parameter was introduced in PrimeNG 15.1.0, please make sure you're running at least this version.
Additionally, since this is a problem in your StackBlitz, please ensure you bind parameter to the property, not string 'endVal':
<!-- in your StackBlitz -->
<p-accordionTab header="Header I" [selected]="true" iconPos="endVal">
<!-- should be -->
<p-accordionTab header="Header I" [selected]="true" [iconPos]="endVal">
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论