答案 0 :(得分:0)
在 var splitter = (str) => {
return JSON.stringify(
str.split(/(\?\?\?)/)
.filter(Boolean)
);
}
// Tests
console.log(splitter("this is some text ???") === JSON.stringify(["this is some text ", "???"]))
console.log(splitter("this is ??? text???") === JSON.stringify(["this is ", "???", " text", "???"]))
console.log(splitter("this is some text") === JSON.stringify(["this is some text"]))
console.log(splitter("(???)") === JSON.stringify(["(", "???", ")"]))
console.log(splitter(" ") === JSON.stringify([" "]))
console.log(splitter(" ??? ") === JSON.stringify([" ", "???", " "]))
console.log(splitter("??????") === JSON.stringify(["???", "???"]))
console.log(splitter("?????????") === JSON.stringify(["???", "???", "???"]))
console.log(splitter("(??????") === JSON.stringify(["(", "???", "???"]))
上添加position="end"
mat-sidenav
https://stackblitz.com/edit/angular-b4gmby-jthbio?file=app/sidenav-autosize-example.html