Basic Vue Router Example using Official Vue Router plugin
A Pen by Swapnil Bhavsar on CodePen.
<?php | |
session_start(); // inicia a sessão | |
if(isset($_SESSION['form'])){ | |
$_SESSION['form'] = array_merge($_SESSION['form'], filter_input_array(INPUT_POST)); // se existir, ele unifica os arrays | |
}else{ | |
$_SESSION['form'] = filter_input_array(INPUT_POST); // se não existir, ele inicializa | |
} | |
var_dump($_SESSION['form']); // dá uma saída de como está ficando o array na session (serve somente de exemplo) |
<template> | |
<div class="Alert Alert--{{ type | capitalize }}"> | |
<slot></slot> | |
</div> | |
</template> | |
<script> | |
export default { | |
props: { | |
type: { |
"devDependencies": { | |
"autoprefixer": "^6.3.6", | |
"browser-sync": "^2.12.3", | |
"cssnext": "^1.8.4", | |
"csswring": "^4.2.2", | |
"gulp-postcss": "^6.1.0", | |
"postcss-nested": "^1.0.0", | |
"gulp": "^3.9.1", | |
"gulp-clean": "^0.3.2", | |
"gulp-cli": "^1.2.1", |
var gulp = require('gulp'); | |
var postcss = require('gulp-postcss'); | |
var inject = require('gulp-inject'); | |
var watch = require('gulp-watch'); | |
var clean = require('gulp-clean'); | |
var concat = require('gulp-concat'); | |
var cssnext = require('cssnext'); | |
var csswring = require('csswring'); | |
var browserSync = require('browser-sync'); | |
var prefix = require('autoprefixer'); |
"devDependencies": { | |
"babel-core": "^6.8.0", | |
"babel-loader": "^6.2.4", | |
"babel-plugin-transform-runtime": "^6.8.0", | |
"babel-preset-es2015": "^6.6.0", | |
"babel-preset-stage-0": "^6.5.0", | |
"babel-runtime": "^6.6.1", | |
"browser-sync": "^2.12.7", | |
"browser-sync-webpack-plugin": "^1.0.1", | |
"css-loader": "^0.23.1", |
// 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.
slug (value) { | |
const mapLetters = { | |
a: /(á|ã|â|à)/g, | |
e: /(é|ê)/g, | |
i: /(í)/g, | |
o: /(ó|ô|õ)/g, | |
u: /(ú)/g, | |
c: /(ç)/g, | |
n: /(ñ)/g | |
} |
import { vueHead } from '/path/to/plugin/vue-head-es6' | |
export default { | |
// use extends with vue v1.0.22+ | |
extends: vueHead | |
// use mixins with vue v1.0.21- | |
// mixins: [head] | |
data () { | |
return { | |
//... |