diff --git a/docs/front-end/04-ES6/20-API.md b/docs/front-end/04-ES6/20-API.md new file mode 100644 index 00000000..a6c716c8 --- /dev/null +++ b/docs/front-end/04-ES6/20-API.md @@ -0,0 +1,76 @@ +# API + +## 全屏API + +可以通过浏览器的 `Fullscreen API` 将任意 DOM 元素或页面全屏化 + +```ts + + + + + + +``` + diff --git "a/docs/front-end/13-project/05-\350\256\276\345\244\207\345\210\227\350\241\250\351\241\265\351\235\242.md" "b/docs/front-end/13-project/05-\350\256\276\345\244\207\345\210\227\350\241\250\351\241\265\351\235\242.md" new file mode 100644 index 00000000..f62301ff --- /dev/null +++ "b/docs/front-end/13-project/05-\350\256\276\345\244\207\345\210\227\350\241\250\351\241\265\351\235\242.md" @@ -0,0 +1,51 @@ +# 设备列表 + +## 背景图的样式 + +```css +background-image: url('@/assets/drawer-bg.jpg'); /* 使用本地图片 */ +background-size: cover; /* 背景填充整个容器 */ +background-position: center; /* 居中显示 */ +background-repeat: no-repeat; /* 不重复 */ + +::v-deep(.el-drawer__body) { + background-image: url(@/assets/nbBg.svg); +} +``` + +## 正则表达式 + +```ts +^8986(11|06)\d{13}$|^898604\d{14}$ +const regex = /^8986(11|06)\d{13}$|^898604\d{14}$/; +``` + +`^8986`:匹配必须以 `8986` 开头的字符串。 + +`(11|06)`:匹配 `8986` 后面的部分,如果是 `11` 或 `06`,则表示后面必须跟 **13 位数字**(总共 19 位)。 + +- `\d{13}`:表示跟随 13 位数字。 + +`|`:表示或者的关系。 + +`898604`:匹配以 `898604` 开头的字符串,后面必须跟 **14 位数字**(总共 20 位)。 + +- `\d{14}`:表示跟随 14 位数字。 + +`$`:表示字符串的结尾。 + +```ts +const regex = /^8986(11|06)\d{13}$|^898604\d{14}$/; + +console.log(regex.test("8986111234567890123")); // true +console.log(regex.test("8986061234567890123")); // true +console.log(regex.test("89860412345678901234")); // true +console.log(regex.test("8986121234567890123")); // false +``` + +## 数据库删除表的数据 + +```ts +databae Ctrl+y 然后点击提交 ctrl+enter +``` +