Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vueComponent/vue-dash-event
The library function, implemented in the DOM template, can use the custom event of the ant-design-vue component (camelCase)
https://github.com/vueComponent/vue-dash-event
Last synced: about 2 months ago
JSON representation
The library function, implemented in the DOM template, can use the custom event of the ant-design-vue component (camelCase)
- Host: GitHub
- URL: https://github.com/vueComponent/vue-dash-event
- Owner: vueComponent
- License: mit
- Created: 2018-12-20T03:27:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-22T10:29:37.000Z (almost 4 years ago)
- Last Synced: 2024-05-16T01:10:58.882Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 86.9 KB
- Stars: 18
- Watchers: 4
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-dash-event
The library function, implemented in the DOM template, can use the custom event of the ant-design-vue component (camelCase)[![NPM version](https://img.shields.io/npm/v/vue-dash-event.svg?style=flat)](https://npmjs.org/package/vue-dash-event) [![NPM downloads](http://img.shields.io/npm/dm/vue-dash-event.svg?style=flat)](https://npmjs.org/package/vue-dash-event)
[![](https://data.jsdelivr.com/v1/package/npm/vue-dash-event/badge)](https://www.jsdelivr.com/package/npm/vue-dash-event)## Usage
```js
Vue.use(window['vue-dash-event'])
```
## Why### If you not use DOM templates, You don't need this plugin.
Unlike components and props, event names don’t provide any automatic case transformation. Instead, the name of an emitted event must exactly match the name used to listen to that event. For example, if emitting a camelCased event name:
```js
this.$emit('myEvent')
```
Listening to the kebab-cased version will have no effect:```html
```
Unlike components and props, event names will never be used as variable or property names in JavaScript, so there’s no reason to use camelCase or PascalCase. Additionally, `v-on` event listeners inside DOM templates will be automatically transformed to lowercase (due to HTML’s case-insensitivity), so `v-on:myEvent` would become `v-on:myevent` – making `myEvent` impossible to listen to.But ant-design-vue use camelCase for event names. In order to properly monitor the internal camelCase events of the component.
If you use DOM templates, you must use `` and `Vue.use(window['vue-dash-event'])`. Then component will monitor the internal camelCase events of the component.