wn-lottery
Version:
95 lines (73 loc) • 2.18 kB
Markdown
# lottery





[](https://github.com/semantic-release/semantic-release)

[](https://travis-ci.org/user/repository)
> 抽奖程序
> Generated using [vue-cli-template-library](https://github.com/julon/vue-cli-template-library).
## Installation
```
npm install lottery
```
lottery can be used as a module in both CommonJS and ES modular environments.
When in non-modular environment, lottery will register all the components to vue by itself.</p>
### ES6
```js
//
// You can register a component manually
//
import { HelloWorld } from 'lottery';
export default {
...
components: {
HelloWorld
},
...
};
//
// or register the whole module with vue
//
import ModuleLibrary from 'lottery';
// Install this library
Vue.use(ModuleLibrary);
```
### CommonJS
```js
//
// You can register a component manually
//
var Vue = require('vue');
var ModuleLibrary = require('lottery');
var YourComponent = Vue.extend({
...
components: {
'hello-world': ModuleLibrary.HelloWorld
},
...
});
//
// or register the whole module with vue
//
var Vue = require('vue');
var ModuleLibrary = require('lottery');
// Install this library
Vue.use(ModuleLibrary);
```
### Browser
```html
<script src="path/to/vue/vue.min.js"></script>
<script src="path/to/lottery/dist/lottery.min.js"></script>
<!-- Components are registered globally -->
```
### After that, you can use it in your templates:
```html
<hello-world></hello-world>
```
## Changelog
See the GitHub [release history](https://github.com/user/repository/releases).
## Contributing
See [CONTRIBUTING.md](.github/CONTRIBUTING.md).