【发布时间】:2018-07-25 00:21:22
【问题描述】:
我在 home.html 页面上添加了一个文本区域。问题是如果我通过按回车键添加数据行,现在当我将其保存在数据库中并在页面上显示时,它会出现在一行中
我是这样打字的:
1. Line one
2. Line two
3. Line three
这是它在页面上的显示方式:
1. Line one 2. Line two 3. Line three
下面是我的HTML代码:
<ion-textarea rows="1" autosize #input (click)="focusInput(input)" (input)="change()" id="messageInputBox" placeholder="Type Something To Send.." type="text" name="TAG" [(ngModel)]="TAG" style="z-index:9.99999; color:#818993;font-size:18px; ">
</ion-textarea>
我该如何解决这个问题?
【问题讨论】:
-
你可以像这样使用“innerHtml”:
-
但它如何使文本出现在不同的行中?你能写一些代码吗?
-
你应该使用这样的东西:
<ul><li>Line one</li><li>Line two</li><li>Line three</li></ul>如果你使用这个字符串作为innerHtml,问题就解决了!或者你可以使用<br>
标签: ionic-framework ionic2 ionic3