Skip to content

Commit

Permalink
Seting name event
Browse files Browse the repository at this point in the history
  • Loading branch information
andrelmlins committed Jan 12, 2020
1 parent fec24bb commit db24445
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
11 changes: 2 additions & 9 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import { HTMLStencilElement, JSXBase } from '@stencil/core/internal';


export namespace Components {
interface MyComponent {
'first': string;
'last': string;
'middle': string;
}
interface MyComponent {}
}

declare global {
Expand All @@ -32,10 +28,7 @@ declare global {

declare namespace LocalJSX {
interface MyComponent {
'first'?: string;
'last'?: string;
'middle'?: string;
'onOnChange'?: (event: CustomEvent<any>) => void;
'onChange'?: (event: CustomEvent<any>) => void;
}

interface IntrinsicElements {
Expand Down
4 changes: 2 additions & 2 deletions src/components/my-component/my-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class MyComponent {
@State() cidades: Array<any> = [];
@State() previsoes: Array<any> = [];

@Event() onChange: EventEmitter;
@Event() change: EventEmitter;

public previsaoOndasService: PrevisaoOndasService;

Expand All @@ -35,7 +35,7 @@ export class MyComponent {
event.target.value
);

this.onChange.emit(this.previsoes);
this.change.emit(this.previsoes);
}

render() {
Expand Down
10 changes: 4 additions & 6 deletions src/components/my-component/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
<!-- Auto Generated Below -->


## Properties
## Events

| Property | Attribute | Description | Type | Default |
| -------- | --------- | --------------- | -------- | ----------- |
| `first` | `first` | The first name | `string` | `undefined` |
| `last` | `last` | The last name | `string` | `undefined` |
| `middle` | `middle` | The middle name | `string` | `undefined` |
| Event | Description | Type |
| -------- | ----------- | ------------------ |
| `change` | | `CustomEvent<any>` |


----------------------------------------------
Expand Down

0 comments on commit db24445

Please sign in to comment.