This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="app"> | |
<Calculadora/> | |
</div> | |
</template> | |
<script> | |
import Calculadora from './components/Calculadora'; | |
export default { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "calculadora-app", | |
"version": "1.0.0", | |
"description": "Calculadora em Vue.js", | |
"author": "Glaucia Lemos", | |
"private": true, | |
"scripts": { | |
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --open --hot", | |
"start": "npm run dev", | |
"lint": "eslint --ext .js,.vue src", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// Usado para dizer ao Node.js que se trata de uma ferramenta do CLI | |
// Declarando os módulos: | |
const chalk = require('chalk') | |
const boxen = require('boxen') | |
// Definindo as opções para o ‘boxen’: | |
const options = { | |
padding: 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Arquivo: defaultProps-jsx.ts | |
* Author: Glaucia Lemos | |
* Data: 23/08/2018 | |
*/ | |
// Antes: | |
/*export interface Props { name?: string } | |
export class Saudar extends React.Component<Props> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Arquivo: defaultProps-jsx.ts | |
* Author: Glaucia Lemos | |
* Data: 23/08/2018 | |
*/ | |
// Antes: | |
export interface Props { name?: string } | |
export class Saudar extends React.Component<Props> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Arquivo: unknown-type.ts | |
* Author: Glaucia Lemos | |
* Data: 23/08/2018 | |
*/ | |
// Agora sim.. vai funfar!! | |
let textoExemplo: unknown = 10; | |
// Aqui vamos colocar com o tipo ‘any’ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Arquivo: unknown-type.ts | |
* Author: Glaucia Lemos | |
* Data: 23/08/2018 | |
*/ | |
let textoExemplo: unknown = 10; | |
// O código abaixo não irá executar uma vez que 'textoExemplo' é do tipo 'unknown' | |
textoExemplo.x.prop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Arquivo: optional-elements.ts | |
* Author: Glaucia Lemos | |
* Data: 23/08/2018 | |
* | |
*/ | |
let teste: [number, string?, boolean?]; | |
teste = [42, 'chocolate', true]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Arquivo: generic-rest-parameters.ts | |
* Author: Glaucia Lemos | |
* Data: 23/08/2018 | |
*/ | |
declare function bind<G, L extends any[], U>(f: (x: G, ...args: L) => U, x: U): (...args: L) => U; | |
declare function f3(x: number, y: string, z: boolean) : void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Arquivo: tuplas-spread-expression.ts | |
* Author: Glaucia Lemos | |
* Data: 23/08/2018 | |
*/ | |
// Exemplo de tuplas sem uso da expressão spread | |
const args: [number, string, boolean] = [32, 'chocolate', true]; | |
foo(32, 'chocolate', true); |