Skip to content

Commit

Permalink
docs: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
riceball-tw authored Dec 7, 2024
1 parent 4eb473b commit 3cf8f0a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ import { EditElement } from '../dist/index.mjs';
const editableElements = new EditElement('.editable');
```

## Advanced Usage
```typescript
import EditElement from 'edit-element';

// Make all elements with .editable class editable
const editableElements = new EditElement('.editable', {
onEnter: (element) => {
console.log('Editing started', element);
},
onSubmit: (element) => {
console.log('Edit submitted', element.textContent);
},
onLeave: (element) => {
console.log('Editing ended', element);
},
editingElementClassName: 'editing'
submitKey: 'Enter',
});
```

## Configuration Options

### `Options` Interface
Expand Down

0 comments on commit 3cf8f0a

Please sign in to comment.