Skip to content

Commit

Permalink
[ADD]basic example
Browse files Browse the repository at this point in the history
  • Loading branch information
CMarzin committed Dec 3, 2018
0 parents commit 8effa27
Show file tree
Hide file tree
Showing 30 changed files with 8,330 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parserOptions: {
parser: 'babel-eslint'
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
'semi': ['error', 'never']
}
}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# dependencies
node_modules

# logs
npm-debug.log

# Nuxt build
.nuxt

# Nuxt generate
dist

.idea/
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# VueJS Starter Project

Ce document explique vite vite comment le starter project marche et ce qu'il inclu.

Pour partir le projet vous devez soit

1. yarn install et yarn run dev (dev + server)
2. yarn install et yarn run build (production) et npm start pour rouler la version production

##Inclus
1. Nuxt (Vue, Vuex, Vue-Router + structure)
2. Axios (ajax)
3. Vee-Validate (validation)

9 changes: 9 additions & 0 deletions app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html {{ HTML_ATTRS }}>
<head>
{{ HEAD }}
</head>
<body {{ BODY_ATTRS }}>
{{ APP }}
</body>
</html>
12 changes: 12 additions & 0 deletions app/mutations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
*
* Store's Mutations
*
*/

export default {
// App wide mutations
setCurrentPage(state, title) {
state.currentPage = title
}
}
10 changes: 10 additions & 0 deletions app/state.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
*
* Store State data
*
*/

export default {
version: '1.0.0',
currentPage: 'home'
}
8 changes: 8 additions & 0 deletions assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ASSETS

This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.

More information about the usage of this directory in the documentation:
https://nuxtjs.org/guide/assets#webpacked

**This directory is not required, you can delete it if you don't want to use it.**
6 changes: 6 additions & 0 deletions components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# COMPONENTS

The components directory contains your Vue.js Components.
Nuxt.js doesn't supercharge these components.

**This directory is not required, you can delete it if you don't want to use it.**
62 changes: 62 additions & 0 deletions components/appButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<template>
<a @click="handleClick" :href="href" :class="'button ' + type">
{{label}}
</a>
</template>

<script>
export default
{
name: 'appButton',
props: {
href: {default: '#', type: String},
type: {default: 'square', type: String},
label: {default: 'Button', type: String},
owner: Object,
call: String
},
methods: {
handleClick(responder)
{
if (typeof this.owner !== 'undefined' && typeof this.call !== 'undefined') {
this.owner[this.call]()
responder.preventDefault()
}
}
}
}
</script>

<style lang="scss" scoped>
.button {
margin: 0 auto;
padding: 5px 10px;
margin-top: 25px;
border: 1px solid blue;
text-decoration: none;
}
.button:hover {
background-color: blue;
color: #fff;
}
.button.danger:hover {
background-color: #fff;
color: #ff0000;
}
.round {
border-radius: 15px;
}
.square {
border-radius: 0;
}
.danger {
background-color: #ff0000;
border-color: #ff0000;
color: #ffffff;
}
</style>
8 changes: 8 additions & 0 deletions layouts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# LAYOUTS

This directory contains your Application Layouts.

More information about the usage of this directory in the documentation:
https://nuxtjs.org/guide/views#layouts

**This directory is not required, you can delete it if you don't want to use it.**
24 changes: 24 additions & 0 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div>
<nuxt/>
</div>
</template>

<script>
// Call on load only (best place to log user in with cookie/JWT)
</script>

<style>
body {
font-family: 'Roboto', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
a {
text-decoration: none;
}
</style>
9 changes: 9 additions & 0 deletions middleware/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MIDDLEWARE

This directory contains your Application Middleware.
The middleware lets you define custom function to be ran before rendering a page or a group of pages (layouts).

More information about the usage of this directory in the documentation:
https://nuxtjs.org/guide/routing#middleware

**This directory is not required, you can delete it if you don't want to use it.**
42 changes: 42 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
/*
** Headers of the page
*/
head: {
title: 'Corentin basic starter',
meta: [
{charset: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
{hid: 'description', name: 'description', content: 'Nuxt.js project'}
],
link: [
{rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'},
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Roboto' }
]
},
plugins: [],

/*
** Customize the progress bar color
*/
//loading: {color: '#3B8070'},
loading: false,
/*
** Build configuration
*/
build: {
/*
** Run ESLint on save
*/
extend(config, {isDev}) {
if (isDev && process.client) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
}
}
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "vuejs-nuxt-starter",
"version": "1.0.0",
"description": "Nuxt.js project",
"author": "Corentin Marzin <[email protected]>",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint"
},
"dependencies": {
"axios": "^0.18.0",
"node-sass": "^4.9.0",
"nuxt": "^2.1.0",
"sass-loader": "^7.0.3"
},
"devDependencies": {
"babel-eslint": "^8.2.1",
"eslint": "^4.15.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-vue": "^4.0.0"
}
}
7 changes: 7 additions & 0 deletions pages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# PAGES

This directory contains your Application Views and Routes.
The framework reads all the .vue files inside this directory and creates the router of your application.

More information about the usage of this directory in the documentation:
https://nuxtjs.org/guide/routing
29 changes: 29 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<template>
<div>
<h1>Example Nuxt + vuex module </h1>
<p>{{ pokemon.name }}</p>
</div>
</template>

<script>
import { mapGetters, mapActions } from 'vuex'
export default {
name: 'mainApp',
computed: {
...mapGetters({
bidule: 'bidule',
pokemon: 'getPokemon'
})
},
mounted() {
console.log('bidule', this.bidule)
this.callPokemonFromAppLogic('1')
},
methods: {
...mapActions({
callPokemonFromAppLogic: 'callPokemonFromAppLogic'
}),
}
}
</script>
11 changes: 11 additions & 0 deletions static/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# STATIC

This directory contains your static files.
Each file inside this directory is mapped to /.

Example: /static/robots.txt is mapped as /robots.txt.

More information about the usage of this directory in the documentation:
https://nuxtjs.org/guide/assets#static

**This directory is not required, you can delete it if you don't want to use it.**
Binary file added static/favicon.ico
Binary file not shown.
49 changes: 49 additions & 0 deletions static/images/loader.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8effa27

Please sign in to comment.