vue-full-calendar
Advanced tools
Comparing version 3.0.0 to 4.0.0-0
@@ -8,1 +8,2 @@ import FullCalendar from './components/FullCalendar.vue' | ||
} | ||
export { FullCalendar } |
{ | ||
"name": "vue-full-calendar", | ||
"version": "3.0.0", | ||
"version": "4.0.0-0", | ||
"description": "FullCalendar wrapper for vue", | ||
@@ -13,3 +13,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "jest -i" | ||
}, | ||
@@ -33,5 +33,36 @@ "repository": { | ||
"dependencies": { | ||
"fullcalendar": "^3.4.0", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"fullcalendar": "^4.0.0-alpha", | ||
"lodash.defaultsdeep": "^4.6.0" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-jest": "^21.2.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"jest": "^21.2.1", | ||
"jest-serializer-vue": "^0.3.0", | ||
"jest-vue": "^0.8.2", | ||
"jquery": "^3.2.1", | ||
"vue": "^2.5.4", | ||
"vue-hot-reload-api": "^2.3.0", | ||
"vue-template-compiler": "^2.5.4" | ||
}, | ||
"jest": { | ||
"moduleFileExtensions": [ | ||
"js", | ||
"vue" | ||
], | ||
"moduleNameMapper": { | ||
"^@/(.*)$": "<rootDir>/$1" | ||
}, | ||
"transform": { | ||
"^.+\\.js$": "<rootDir>/node_modules/babel-jest", | ||
".*\\.(vue)$": "<rootDir>/node_modules/jest-vue" | ||
}, | ||
"snapshotSerializers": [ | ||
"<rootDir>/node_modules/jest-serializer-vue" | ||
], | ||
"mapCoverage": true | ||
} | ||
} |
# vue-fullcalendar | ||
[![npm version](https://badge.fury.io/js/vue-full-calendar.svg)](https://badge.fury.io/js/vue-full-calendar) | ||
[![Build Status](https://travis-ci.org/CroudSupport/vue-fullcalendar.svg?branch=master)](https://travis-ci.org/CroudSupport/vue-fullcalendar) | ||
@@ -14,16 +15,26 @@ | ||
and use in your project | ||
Installing the plugin will globally add the `full-calendar` component to your project. | ||
```js | ||
//main.js | ||
import FullCalendar from 'vue-full-calendar' | ||
Vue.use(FullCalendar) | ||
``` | ||
### jQuery | ||
Please note that fullcalendar depends on jQuery, so it will need to be included in your project for this vue plugin to work | ||
But you can also import the standalone component to add locally or for more complex installations. | ||
```js | ||
window.jQuery = window.$ = require('jquery') | ||
// foo.vue | ||
import { FullCalendar } from 'vue-full-calendar' | ||
export default { | ||
components: { | ||
FullCalendar, | ||
}, | ||
} | ||
``` | ||
### jQuery | ||
Please note that fullcalendar depends on jQuery, but you won't need to add it to your project manually, fullcalendar will handle this for you automatically if jQuery is not detected. | ||
### CSS | ||
@@ -38,5 +49,10 @@ As of version 2.0, we have removed the automatic import of the fullcalendar.css, you will need to explicitly import this css file in your project. | ||
## Example App | ||
I have created a simple Vue 2 webpack application to as an example/playground | ||
I have created a simple Vue 2 webpack application as an example/playground | ||
https://github.com/BrockReece/vue-fullcalendar-example | ||
or try out this [Code Sandbox](https://codesandbox.io/s/5xlp873rkl) | ||
### Scheduler | ||
For those wanting to use the scheduler plugin, this [Code Sandbox](https://codesandbox.io/s/qlp8jvko3j) shows you a full working example. | ||
## Basic Usage | ||
@@ -110,2 +126,48 @@ | ||
## Custom Config | ||
You can pass any custom [options](https://fullcalendar.io/docs/) through to fullcalendar by using the `config` prop, this includes extra event handlers. | ||
```html | ||
<full-calendar :events="events" :config="config" /> | ||
... | ||
<script> | ||
... | ||
data() { | ||
return { | ||
events: [], | ||
config: { | ||
weekends: false, | ||
drop(...args) { | ||
//handle drop logic in parent | ||
}, | ||
}, | ||
} | ||
}, | ||
... | ||
</script> | ||
``` | ||
## Locale | ||
You can set the language of your calendar by importing the corresponding locale file and setting the `locale` key in the config prop. For example, to set up the Calendar in French... | ||
```html | ||
<full-calendar :events="events" :config="config" /> | ||
... | ||
<script> | ||
import 'fullcalendar/dist/locale/fr' | ||
... | ||
data() { | ||
return { | ||
events: [], | ||
config: { | ||
locale: 'fr', | ||
}, | ||
} | ||
}, | ||
... | ||
</script> | ||
``` | ||
[Code Sandbox](https://codesandbox.io/s/8yl1xwk388) | ||
*Note: You won't need to set the locale config key if your app only imports a single locale file* | ||
## Further Props | ||
@@ -121,2 +183,27 @@ You can edit the look and feel of fullcalendar by passing through extra props. These all have sensible defaults | ||
## Methods | ||
Sometimes you may need to manipulate the Calendar from your parent component, you can use `fireMethod` for this. This works with anything in the [Fullcalendar docs](https://fullcalendar.io/docs/) suffixed with `(method)` and it will dynamically handle as many arguments as needed. | ||
```html | ||
<full-calendar :events="events" ref="calendar" /> | ||
... | ||
<script> | ||
... | ||
data() { | ||
return { | ||
events: [], | ||
} | ||
}, | ||
methods: { | ||
next() { | ||
this.$refs.calendar.fireMethod('next') | ||
}, | ||
changeView(view) { | ||
this.$refs.calendar.fireMethod('changeView', view) | ||
}, | ||
}, | ||
... | ||
</script> | ||
``` | ||
## Events and Hooks | ||
@@ -129,2 +216,4 @@ | ||
- __event-created(event)__ - Triggered on select() | ||
- __event-receive(event)__ - Triggered on eventReceive() | ||
- __event-render(event)__ - Triggered on eventRender() | ||
- __day-click(date, jsEvent, view)__ - Triggered on dayClick() | ||
@@ -131,0 +220,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
139076
9
75
243
0
3
11
+ Addedasynckit@0.4.0(transitive)
+ Addedbabel-plugin-transform-runtime@6.23.0(transitive)
+ Addedbabel-runtime@6.26.0(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addedcookiejar@2.1.4(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddebug@3.2.7(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedform-data@2.5.1(transitive)
+ Addedformidable@1.2.6(transitive)
+ Addedfullcalendar@4.0.0-alpha.4(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedluxon@1.28.1(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@1.6.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedmoment-timezone@0.5.45(transitive)
+ Addedms@2.1.3(transitive)
+ Addedobject-inspect@1.13.1(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedqs@6.12.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedregenerator-runtime@0.11.1(transitive)
+ Addedrrule@2.8.1(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedsuperagent@3.8.3(transitive)
+ Addedtslib@2.6.2(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedfullcalendar@3.10.5(transitive)
- Removedjquery@3.7.1(transitive)
Updatedfullcalendar@^4.0.0-alpha