Hon*_*iao 19 javascript css angular
我正在使用Angular 2.
当我在SCSS文件中使用它时,它运行良好.
.text::after {
content: "\00a0\00a0";
}
Run Code Online (Sandbox Code Playgroud)
但是,当我搬进去的时候
styles: [``]
Run Code Online (Sandbox Code Playgroud)
表明:
Uncaught SyntaxError:严格模式下不允许使用八进制文字.
我知道代码styles: [``]需要是CSS代码.
我试过了
styles: [`
.text::after {
content: " ";
}
`]
Run Code Online (Sandbox Code Playgroud)
但随后屏幕 直接显示.我该怎么写得正确?
Ank*_*ngh 28
你需要逃脱它
.text::after {
content: "\\00a0\\00a0"; // now it's just a simple plain string
}
Run Code Online (Sandbox Code Playgroud)
"use strict"是JavaScript 1.8.5(ECMAScript第5版)中引入的新功能.
其中,
| 归档时间: |
|
| 查看次数: |
22825 次 |
| 最近记录: |