This repository has been archived by the owner on Mar 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored directives, added them to docs
- Loading branch information
1 parent
2bf51cd
commit 422d4a7
Showing
9 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Autofocus <badge text="stable" /> | ||
|
||
The `v-autofocus` directive do auto focus when document is ready. | ||
|
||
## Example | ||
<div class="p-3 border rounded-2 my-3 flex"> | ||
<input v-autofocus="true" placeholder="Auto focusable input" /> | ||
</div> | ||
|
||
|
||
```html | ||
<input v-autofocus="true" placeholder="Auto focusable input" /> | ||
``` | ||
|
||
## Arguments | ||
Name | type | Description | ||
-------- | -----------| ----- | ||
main | Boolean | Whether auto focus is enabled or not | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Clickoutside <badge text="stable" /> | ||
|
||
The `v-clickoutside` directive allows to run callback on click out of element. | ||
|
||
## Example | ||
<div class="p-3 border rounded-2 my-3 flex"> | ||
<v-button v-clickoutside="handleClickoutside" appearance="primary">Click me or miss</v-button> | ||
</div> | ||
|
||
|
||
```html | ||
<v-button | ||
appearance="primary" | ||
v-clickoutside="handleClickoutside" | ||
> | ||
Click me or miss | ||
</v-button> | ||
``` | ||
|
||
```javascript | ||
export default { | ||
methods: { | ||
handleClickoutside() { | ||
alert('You clicked outside the button!'); | ||
}, | ||
}, | ||
}; | ||
``` | ||
|
||
<script> | ||
export default { | ||
methods: { | ||
handleClickoutside() { | ||
alert('You clicked outside the button!'); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
## Arguments | ||
Name | type | Description | ||
-------- | -----------| ----- | ||
main | Function | Callback that will be executed on clickoutside |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Autofocus from './autofocus'; | ||
|
||
// eslint-disable-next-line func-names | ||
Autofocus.install = function (Vue) { | ||
Vue.directive('Autofocus', Autofocus); | ||
}; | ||
|
||
export default Autofocus; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Clickoutside from './clickoutside'; | ||
|
||
// eslint-disable-next-line func-names | ||
Clickoutside.install = function (Vue) { | ||
Vue.directive('Clickoutside', Clickoutside); | ||
}; | ||
|
||
export default Clickoutside; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as Autofocus } from './autofocus'; | ||
export { default as Clickoutside } from './clickoutside'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters