0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-12 11:51:54 +00:00

Converted entity-dash from vue to a component

This commit is contained in:
Dan Brown 2020-06-28 21:15:00 +01:00
parent a5fa745749
commit 10305a4446
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
10 changed files with 111 additions and 90 deletions

View file

@ -1,16 +1,22 @@
# JavaScript Components
This document details the format for JavaScript components in BookStack.
This document details the format for JavaScript components in BookStack. This is a really simple class-based setup with a few helpers provided.
#### Defining a Component in JS
```js
class Dropdown {
setup() {
this.toggle = this.$refs.toggle;
this.menu = this.$refs.menu;
this.speed = parseInt(this.$opts.speed);
}
}
```
All usage of $refs, $manyRefs and $opts should be done at the top of the `setup` function so any requirements can be easily seen.
#### Using a Component in HTML
A component is used like so: