【发布时间】:2017-11-28 08:30:54
【问题描述】:
我正在 typescript 组件中创建一个列表项,该列表项将显示在 UI 中。列表项应显示在单独的行中。所以我添加了新行 char \n 如下。但列表项仍然显示在同一行。下面是代码。知道为什么它不起作用吗?
打字稿代码:
@Output() excludeDisplay: any = '';
@Output() includeDisplay: any = '';
includeValues: any = '';
excludeValues: any = '';
this.includeValues += this.merId + ',' + this.explodeStatus + '\n';
console.log("include values are "+ this.includeValues);
this.excludeValues += this.merId + ',' + this.explodeStatus + '\n';
console.log("exclude values are "+ this.excludeValues);
this.includeDisplay = this.includeValues;
this.excludeDisplay = this.excludeValues;
HTML代码:
<ul id="excludedUl" required>{{ excludeDisplay }}</ul>
<ul id="includedUl" required>{{ includeDisplay }}</ul>
CSS 代码:
#includedUl {
float: right;
width: 33%;
}
#excludedUl {
float: right;
width: 33%;
}
【问题讨论】:
-
这是可行的解决方案.....stackoverflow.com/a/69753810/7320692
标签: css html typescript