Dev: Update util

This commit is contained in:
surunzi
2018-03-25 22:35:41 +08:00
parent 2a6b4d81d7
commit 63010b3d52
2 changed files with 86 additions and 13 deletions

View File

@@ -1640,7 +1640,7 @@ Inject script tag into page with given src value.
|cb |function|Onload callback|
```javascript
loadJs('main.js', function ()
loadJs('main.js', function (isLoaded)
{
// Do something...
});
@@ -1904,6 +1904,25 @@ var start = perfNow();
console.log(perfNow() - start);
```
## prefix
Add vendor prefixes to a CSS attribute.
|Name |Type |Desc |
|------|------|----------------------|
|name |string|Property name |
|return|string|Prefixed property name|
### dash
Create a dasherize version.
```javascript
prefix('text-emphasis'); // -> 'WebkitTextEmphasis'
prefix.dash('text-emphasis'); // -> '-webkit-text-emphasis'
prefix('color'); // -> 'color'
```
## pxToNum
Turn string like '0px' to number.