Skip to content

Commit d05f4cc

Browse files
authored
Merge pull request #1 from atsutopia/feature/v0.0.1
v0.0.1
2 parents 42eccc7 + 62337cf commit d05f4cc

14 files changed

+10888
-1
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015"]
3+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (C) 2019 by [atsutopia](https://github.com/atsutopia)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,73 @@
1-
# vue-swipeable-bottom-sheet
1+
# Vue Swipeable Bottom Sheet
2+
3+
![NPM](https://nodei.co/npm/vue-swipeable-bottom-sheet.png)
4+
[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/atsutopia/vue-swipeable-bottom-sheet)
5+
6+
A swipeable material's bottom sheet implementation, that uses [hammerjs](https://github.com/hammerjs/hammer.js).
7+
8+
[Demo](https://atsutopia.github.io/vue-swipeable-bottom-sheet/dist)
9+
10+
## Installation
11+
12+
#### NPM
13+
14+
```
15+
npm install --save vue-swipeable-bottom-sheet
16+
```
17+
18+
or
19+
20+
#### Yarn
21+
22+
```
23+
yarn add vue-swipeable-bottom-sheet
24+
```
25+
26+
## Usage
27+
28+
```
29+
<template>
30+
<swipeable-bottom-sheet ref="swipeableBottomSheet">
31+
<h1>Lorem Ipsum</h1>
32+
<h2>What is Lorem Ipsum?</h2>
33+
<p>
34+
<strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
35+
</p>
36+
</swipeable-bottom-sheet>
37+
</template>
38+
39+
<script>
40+
import { SwipeableBottomSheet } from "vue-swipeable-bottom-sheet";
41+
42+
export default {
43+
components: {
44+
SwipeableBottomSheet
45+
},
46+
}
47+
</script>
48+
```
49+
50+
#### mount with ssr
51+
52+
```
53+
<template>
54+
<no-ssr>
55+
<swipeable-bottom-sheet ref="swipeableBottomSheet">
56+
<h1>Lorem Ipsum</h1>
57+
<h2>What is Lorem Ipsum?</h2>
58+
<p>
59+
<strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
60+
</p>
61+
</swipeable-bottom-sheet>
62+
</no-ssr>
63+
</template>
64+
65+
if (process.browser) {
66+
const SwipeableBottomSheet = require('vue-swipeable-bottom-sheet')
67+
Vue.component("swipeable-bottom-sheet", SwipeableBottomSheet)
68+
}
69+
```
70+
71+
## License
72+
73+
[MIT](LICENSE)

example/example.vue

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<template>
2+
<div>
3+
<h1>Example</h1>
4+
<button @click="open">Open</button>
5+
<button @click="half">Half</button>
6+
<button @click="close">Close</button>
7+
<swipeable-bottom-sheet ref="swipeableBottomSheet">
8+
<h1>Lorem Ipsum</h1>
9+
<h2>What is Lorem Ipsum?</h2>
10+
<p>
11+
<strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
12+
</p>
13+
<h2>Where does it come from?</h2>
14+
<p>
15+
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
16+
</p>
17+
<h2>Why do we use it?</h2>
18+
<p>
19+
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
20+
</p>
21+
22+
</swipeable-bottom-sheet>
23+
</div>
24+
</template>
25+
26+
<script>
27+
import { SwipeableBottomSheet } from '../src';
28+
29+
export default {
30+
components: {
31+
SwipeableBottomSheet
32+
},
33+
methods: {
34+
half () {
35+
this.$refs.swipeableBottomSheet.setState("half")
36+
},
37+
open () {
38+
this.$refs.swipeableBottomSheet.setState("open")
39+
},
40+
close () {
41+
this.$refs.swipeableBottomSheet.setState("close")
42+
}
43+
}
44+
}
45+
</script>

example/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="MobileOptimized" content="320">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui, maximum-scale=1.0, minimum-scale=1.0">
7+
<title>vue-swipe examples</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="text/javascript" src="/dist/example.js"></script>
12+
</body>
13+
</html>

example/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Vue from 'vue';
2+
import Example from './example.vue';
3+
4+
new Vue({
5+
el: '#app',
6+
render: h => h(Example)
7+
});

0 commit comments

Comments
 (0)