Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
Updated to 0.2.0 (#13)
Browse files Browse the repository at this point in the history
Updated to 0.2.0
- Added scoped slot for custom suggestions
- Added some basic unit tests
- Added UMD/CommonJS library builds
- Added unpkg tag to packags.json
- Updated documentation website (prep for gh-pages)
  • Loading branch information
alexurquhart authored Sep 6, 2018
1 parent db55a96 commit d77144d
Show file tree
Hide file tree
Showing 28 changed files with 6,032 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
> 1%
last 2 versions
not ie <= 8
not ie <= 9
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.DS_Store
node_modules
/dist

# local env files
.env.local
Expand Down
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: node_js
node_js:
- "8"
script:
- npm run lint
- npm run test:unit
- npm run build
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<<<<<<< HEAD
# 0.1.2 - 28 Aug 2018
Fixed issues #3 & #4
=======
## 0.1.2 - 28 Aug 2018
- Fixed #3 & #4
>>>>>>> #3

## 0.2.0 - 6 Sept 2018
- Added a scoped slot for custom suggestion list items
- Added library build + unpkg tags
- Updated documentation site (working on gh-pages)
- Added basic unit tests
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,27 @@ Name | Description

There are `prepend` and `append` slots available for adding buttons or other markup. Overrides the `prepend` and `append` attributes.

### Scoped Slots

You can use a [scoped slot](https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots) called `suggestion` to define custom content
for the suggestion `list-item`'s

```html
<vue-bootstrap-typeahead
:data="countries"
v-model="cntrySearch"
:serializer="s => s.name"
placeholder="Canada, United States, etc..."
@hit="selectedCountry = $event"
>
<!-- htmlText is bound to the matched text derived from the serializer function -->
<!-- data is bound to the matching array element in the data prop -->
<template slot="suggestion" slot-scope="{ data, htmlText }">
<span v-html="htmlText"></span>&nbsp;<small>{{ data.code }}</small>
</template>
</vue-bootstrap-typeahead>
```

## Examples/Demo

Clone this repository and run `npm run serve` and navigate to http://localhost:8080 to launch some examples. The source is in `src/views/Home.vue`
Expand Down
Loading

0 comments on commit d77144d

Please sign in to comment.