Basic Vue Router Example using Official Vue Router plugin
A Pen by Swapnil Bhavsar on CodePen.
| <template> | |
| <div class="Alert Alert--{{ type | capitalize }}"> | |
| <slot></slot> | |
| </div> | |
| </template> | |
| <script> | |
| export default { | |
| props: { | |
| type: { |
| // rm -rf ./build && webpack --config webpack.prod.config.js -p --progress | |
| var path = require('path'); | |
| var webpack = require('webpack'); | |
| var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
| var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| var ROOT = __dirname; | |
| var PROJECT_ROOT = path.join(ROOT, 'src'); | |
| var BUILD_ROOT = path.join(ROOT, 'build'); |
| import Vue from 'vue' | |
| import VueRouter from 'vue-router' | |
| Vue.use(VueRouter) | |
| Vue.use(require('vue-resource')) | |
| const router = new VueRouter({ | |
| history : true, | |
| saveScrollPosition: true | |
| }); |
Basic Vue Router Example using Official Vue Router plugin
A Pen by Swapnil Bhavsar on CodePen.
v. 1.0.
Pode-se afirmar que no momento Promises são a forma mais "padrão" de se tratar com
assincronismo no JS. Para quem trabalha com javascript, conhecê-las é essencial.
Uma dificuldade comum é que esta API tem uma curva de aprendizado um tanto acentuada de início, especialmente
se comparado com as alternativas mais antigas: callbacks e o módulo async. No meu caso, levei ao menos uns 3
meses pra "cair a ficha".
| FROM php:5.6-apache | |
| RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql | |
| COPY src/ /var/www/html |
| FROM php:7-fpm | |
| # Install modules | |
| RUN apt-get update && apt-get install -y \ | |
| libfreetype6-dev \ | |
| libjpeg62-turbo-dev \ | |
| libmcrypt-dev \ | |
| libpng12-dev \ | |
| libmemcached-dev \ | |
| libmysqlclient-dev \ | |
| libicu-dev \ |
| FROM php:7-fpm | |
| RUN apt-get update && apt-get install -y git libcurl4-gnutls-dev zlib1g-dev libicu-dev g++ libxml2-dev libpq-dev \ | |
| && git clone -b php7 https://github.com/phpredis/phpredis.git /usr/src/php/ext/redis \ | |
| && docker-php-ext-install pdo pdo_mysql pdo_pgsql pgsql intl curl json opcache xml redis \ | |
| && apt-get autoremove && apt-get autoclean \ | |
| && rm -rf /var/lib/apt/lists/* |
| <style> | |
| .Alert { | |
| padding: 2em; | |
| } | |
| .Alert-Success { | |
| border: 10px solid green; | |
| } | |
| .Alert-Error { | |
| border: 10px solid red; | |
| } |