Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
eaCe authored Dec 5, 2023
1 parent b0ca70e commit b42b472
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ You may pass an array of values as the first argument.

### `$log()`

Write a message to the console.

```html
<div x-data="{ foo: 'bar' }">
<button @click="$log(foo)">Log</button>
Expand All @@ -35,6 +37,8 @@ You may pass an array of values as the first argument.

### `$warn()`

Write a warning message to the console.

```html
<div x-data="{ foo: 'bar' }">
<button @click="$warn(foo)">Log</button>
Expand All @@ -43,6 +47,8 @@ You may pass an array of values as the first argument.

### `$error()`

Write an error message to the console.

```html
<div x-data="{ foo: 'bar' }">
<button @click="$error(foo)">Log</button>
Expand All @@ -51,6 +57,8 @@ You may pass an array of values as the first argument.

### `$info()`

Write an informational message to the console.

```html
<div x-data="{ foo: 'bar' }">
<button @click="$info(foo)">Log</button>
Expand All @@ -59,6 +67,8 @@ You may pass an array of values as the first argument.

### `$table()`

Writes a table in the console view.

```html
<div x-data="">
<button @click="$table({ foo: 'bar', bar: 'foo'})">Log</button>
Expand All @@ -67,6 +77,8 @@ You may pass an array of values as the first argument.

### `$clear()`

Clears the console.

```html
<div x-data="">
<button @click="clear();$log('foo')">Clear previous logs and log</button>
Expand All @@ -75,6 +87,8 @@ You may pass an array of values as the first argument.

### `$group()` and `$groupEnd()`

Creates a new group in the console view.

```html
<div x-data="">
<button @click="$group('Groupname');$log('foo');$log('bar');$groupEnd()">Group logs</button>
Expand All @@ -85,13 +99,17 @@ You may pass an array of values as the first argument.

### `$width` and `$width()`

Get or set the width of an element.

```html
<div x-data x-text="$width"></div>
<div x-data x-init="$width('200px')"></div>
```

### `$height` and `$height()`

Get or set the height of an element.

```html
<div x-data x-text="$height"></div>
<div x-data x-init="$height('200px')"></div>
Expand All @@ -101,6 +119,8 @@ You may pass an array of values as the first argument.

### `$offset().top` and `$offset().left`

Get the offset of an element.

```html
<div x-data x-text="$offset().top"></div>
<div x-data x-text="$offset().left"></div>
Expand All @@ -110,13 +130,16 @@ You may pass an array of values as the first argument.

### `$hasClass()`

Checks if an element has a class.

```html
<div x-data x-text="$hasClass('foo')" class="foo"></div>
```

### `$trim()`

Trims whitespace from the beginning and end of a string.

```html
<div x-data x-text="$trim(' foo ')"></div>
```

0 comments on commit b42b472

Please sign in to comment.