Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: complete docs. Build lib/docs
- Loading branch information
1 parent
40ba5df
commit 99887eb
Showing
24 changed files
with
285 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,80 @@ | ||
# Vue Stripe Menu | ||
|
||
[Website](https://alexeykhr.github.io/vue-stripe-menu/) | ||
> Create a dropdown like on Stripe | ||
## Project setup | ||
[Demo Project](https://alexeykhr.github.io/vue-stripe-menu/) | ||
|
||
## How to install | ||
|
||
```shell script | ||
$ npm i vue-stripe-menu | ||
// or | ||
$ yarn add vue-stripe-menu | ||
``` | ||
npm install | ||
|
||
```vue | ||
import Vue from 'Vue' | ||
import VueStripeMenu from 'vue-stripe-menu' | ||
Vue.use(VueStripeMenu) | ||
``` | ||
|
||
### Compiles and hot-reloads for development | ||
## Basic Demo | ||
|
||
```vue | ||
<template> | ||
<vsm-menu :menu="menu"> | ||
<template #default="data"> | ||
{{ data }} | ||
</template> | ||
</vsm-menu> | ||
</template> | ||
<script> | ||
export default { | ||
data() { | ||
return { | ||
menu: [ | ||
{ title: 'First item', dropdown: 'first' }, | ||
{ title: 'Second item', dropdown: 'second' }, | ||
{ title: 'No dropdown' } | ||
] | ||
} | ||
} | ||
} | ||
</script> | ||
``` | ||
npm run serve | ||
|
||
## Advanced Demo | ||
|
||
How on the site: [Link](https://github.com/Alexeykhr/vue-stripe-menu/blob/master/demo) | ||
|
||
## Contributing | ||
|
||
### Launch of a demo project (development of lib) | ||
``` | ||
npm run dev | ||
``` | ||
|
||
### Compiles and minifies for production | ||
### Build a demo project | ||
``` | ||
npm run build | ||
``` | ||
|
||
### Run your tests | ||
### Build library | ||
``` | ||
npm run test | ||
npm run build:lib | ||
``` | ||
|
||
### Lints and fixes files | ||
### Check code on eslint | ||
``` | ||
npm run lint | ||
``` | ||
|
||
## Changelog | ||
|
||
Detailed changes for each release are documented in the [CHANGELOG.md](https://github.com/alexeykhr/vuejs-stripe-menu/blob/master/CHANGELOG.md). | ||
|
||
## License | ||
|
||
[MIT](https://opensource.org/licenses/MIT) |
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
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
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,39 @@ | ||
<template> | ||
<a | ||
:href="`#${generatedId}`" | ||
:id="generatedId" | ||
class="section" | ||
> | ||
# <slot>{{ title }}</slot> | ||
</a> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
title: { | ||
type: String, | ||
default: '' | ||
}, | ||
id: { | ||
type: String, | ||
default: '' | ||
} | ||
}, | ||
computed: { | ||
generatedId () { | ||
if (this.id) { | ||
return this.id | ||
} | ||
let id = this.title | ||
if (this.$slots.default) { | ||
id = this.$slots.default[0].text | ||
} | ||
return id.trim().toLowerCase().replace(/[^a-z-]/gi, '-') | ||
} | ||
} | ||
} | ||
</script> |
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
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,27 @@ | ||
<template> | ||
<div> | ||
<base-title title="Example" /> | ||
<pre><code class="javascript">{{ ExampleRaw }}</code></pre> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
// eslint-disable-next-line | ||
import ExampleRaw from '!!raw-loader!./ExampleRaw' | ||
import BaseTitle from '../BaseTitle' | ||
import highlight from 'highlight.js' | ||
export default { | ||
components: { | ||
BaseTitle | ||
}, | ||
data () { | ||
return { | ||
ExampleRaw | ||
} | ||
}, | ||
mounted () { | ||
highlight.initHighlightingOnLoad() | ||
} | ||
} | ||
</script> |
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,21 @@ | ||
<template> | ||
<vsm-menu :menu="menu"> | ||
<template #default="data"> | ||
{{ data }} | ||
</template> | ||
</vsm-menu> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
menu: [ | ||
{ title: 'First item', dropdown: 'first' }, | ||
{ title: 'Second item', dropdown: 'second' }, | ||
{ title: 'No dropdown' } | ||
] | ||
} | ||
} | ||
} | ||
</script> |
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,31 @@ | ||
<template> | ||
<div> | ||
<base-title title="Install" /> | ||
<pre><code class="shell">{{ shell }}</code></pre> | ||
<pre><code class="javascript">{{ vue }}</code></pre> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import BaseTitle from '../BaseTitle' | ||
import highlight from 'highlight.js' | ||
export default { | ||
components: { | ||
BaseTitle | ||
}, | ||
data () { | ||
return { | ||
shell: '$ npm i vue-stripe-menu\n' + | ||
'// or\n' + | ||
'$ yarn add vue-stripe-menu', | ||
vue: 'import Vue from \'Vue\'\n' + | ||
'import VueStripeMenu from \'vue-stripe-menu\'\n\n' + | ||
'Vue.use(VueStripeMenu)' | ||
} | ||
}, | ||
mounted () { | ||
highlight.initHighlightingOnLoad() | ||
} | ||
} | ||
</script> |
Oops, something went wrong.