项目作者: julon

项目描述 :
CreativeCommons.org Vue.js components library ©️!
高级语言: JavaScript
项目地址: git://github.com/julon/vue-creativecommons.git
创建时间: 2018-01-07T16:33:35Z
项目社区:https://github.com/julon/vue-creativecommons

开源协议:MIT License

下载


vue-creativecommons

Rollup badge
Jest
Vue
Storybook
Commitizen
semantic-release
Npm badge
Build Status
Coverage Status
Greenkeeper badge

CreativeCommons.org Vue.js components library.

Generated using vue-cli-template-library.

Installation

  1. npm install vue-creativecommons

vue-creativecommons can be used as a module in both CommonJS and ES modular environments.

When in non-modular environment, vue-creativecommons will register all the components to vue by itself.

ES6

  1. //
  2. // You can register a component manually
  3. //
  4. import { CreativeCommonsIcon, CreativeCommonsLabel } from 'vue-creativecommons';
  5. export default {
  6. ...
  7. components: {
  8. CreativeCommonsIcon,
  9. CreativeCommonsLabel
  10. },
  11. ...
  12. };
  13. //
  14. // or register the whole module with vue
  15. //
  16. import vueCreativeCommons from 'vue-creativecommons';
  17. // Install this library
  18. Vue.use(vueCreativeCommons);

CommonJS

  1. //
  2. // You can register a component manually
  3. //
  4. var Vue = require('vue');
  5. var vueCreativeCommons = require('vue-creativecommons');
  6. var YourComponent = Vue.extend({
  7. ...
  8. components: {
  9. 'cc-icon': vueCreativeCommons.CreativeCommonsIcon,
  10. 'cc-label': vueCreativeCommons.CreativeCommonsLabel
  11. },
  12. ...
  13. });
  14. //
  15. // or register the whole module with vue
  16. //
  17. var Vue = require('vue');
  18. var vueCreativeCommons = require('vue-creativecommons');
  19. // Install this library
  20. Vue.use(vueCreativeCommons);

Browser

  1. <script src="path/to/vue/vue.min.js"></script>
  2. <script src="path/to/vue-creativecommons/dist/vue-creativecommons.min.js"></script>
  3. <!-- Components are registered globally -->

Usage

Icon component

Example

  1. <!-- normal icon -->
  2. <cc-icon allow-adaptations="yes" allow-commercial-use="yes" icon-size="normal"></cc-icon>
  3. <!-- compact icon -->
  4. <cc-icon allow-adaptations="yes" allow-commercial-use="yes" icon-size="compact"></cc-icon>

alt text
alt text

Props

  • allowAdaptations(required) - Allow adaptations of your work to be shared? yes, no or share-alike
  • allowCommercialUse(required) - Allow commercial uses of your work? yes or no
  • iconSize(required) : compact or normal

Label component

Example

  1. <cc-label allow-adaptations="yes" allow-commercial-use="yes"></cc-label>

This work is licensed under a Creative Commons Attribution 4.0 International License.

Props

  • allowAdaptations(required) - Allow adaptations of your work to be shared? yes, no or share-alike
  • allowCommercialUse(required) - Allow commercial uses of your work? yes or no

Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.