asyncguo

Results 48 comments of asyncguo

> 像你这种情况,通常都会基于 proTable... proForm... 并结合项目的需求再抽象封装一层。 二次封装组件无疑是最好的选择,而类似`proTable`这种多配置项的非原子组件,在发布`break changes`更新版本时,对于存量使用的地方更改起来很是不方便,而`Provider`这种方式感觉会更方便点

[demo](https://codepen.io/asyncguo/pen/MWYqxoZ?editors=1100) ```css // flex布局,局限:需要定宽 :root { --box-width: 810px; --box-width-negative: -810px; } .list{ list-style-type: none; width: var(--box-width); height: 360px; margin: 0; padding: 0; display: flex; flex-wrap:wrap; padding-left: calc((var(--box-width) - 5px *...

[demo](https://codepen.io/asyncguo/pen/XWWGzXL?editors=1010) ```js let list = document.getElementById('list') let aLi = Array.from(list.children) // 存储当前DOM索引 let current_highlight = null list.addEventListener('click', (e) => { if (e.target.nodeName === 'LI') { handleInputAndLi(e.target) } }) document.addEventListener('keydown', (e)...

```js const validateParams = (v, max) => !isNaN(v) && v >= 0 && v < max 1. 交换位置 function exchangeArr (arr, index1, index2) { // 校验索引 if (!validateParams(index1, arr.length) ||...

```js // 第一题 let test1 = '6222081812002934027'.replace(/(\d{4})(?=(\d))/g, '$1 ') console.log(test1) // 保证最后一位始终不会出现空格 let test2 = '62220818120029340270'.replace(/(\d{4})(?=(\d))/g, '$1 ') console.log(test2) // 第二题 let test3 = '5702375'.replace(/(?!^)(?=(\d{3})+$)/g, ',') console.log(test3) // 保证第一位始终不会出现分隔符 let...

[demo](https://codepen.io/asyncguo/pen/yLLEYrw?editors=1100) ```html 1-规则声明 2-参与活动 3-参与抽奖 4-奖品发放 5-查看结果 ``` ```css .step-item{ margin-left: -30px; display: inline-block; padding: 25px 55px; font-size: 16px; font-weight: 500; clip-path: polygon(0% 0%, calc(100% - 30px) 0%,100% 50%,calc(100% -...

[demo](https://codepen.io/asyncguo/pen/BXaJWo) ```css .list{ height: 40px; line-height: 40px; } .info{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .info.direction-rtl{ direction: rtl; text-align: left; } .tags{ float: right; } .tag{ padding: 3px 5px;...

[demo](https://codepen.io/asyncguo/pen/mNxPoX?editors=1100) ```html 布局 Flex布局 Grid布局 Shapes布局 Columns布局 组件 按钮 输入框 下拉列表 单复选框 ``` ```css .menu-list { width: 150px; border-left: 1px solid #eee; border-right: 1px solid #eee; } details { width:...

```js // 1. str = str.replace(/[\s]+fill=(?!"none")[^\s\/\>]+/g, '') //2. window.btoa(str) // 3. str.replace(/["%#{}]/g, encodeURI) ```

```js 1. "1" 2. "2" 3. "0.04" 4. "0.04" ``` 5-6. 下面的方法完全以字符串的方式进行处理 ```js function toFixedFn (digits) { if (digits < 0) throw new Error("位数不得小于0"); let [intNum, floatNum] = this.toString().split("."); //...