Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2c8f0b6
Showing
24 changed files
with
8,058 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
browser: true, | ||
node: true | ||
}, | ||
parserOptions: { | ||
parser: 'babel-eslint' | ||
}, | ||
extends: [ | ||
'plugin:vue/recommended', | ||
'plugin:prettier/recommended' | ||
], | ||
// required to lint *.vue files | ||
plugins: [ | ||
'vue', | ||
'prettier' | ||
], | ||
// add your custom rules here | ||
rules: { | ||
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Node template | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# Nuxt generate | ||
dist | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless | ||
|
||
# IDE | ||
.idea |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# nuxt-ts-example | ||
|
||
> My praiseworthy Nuxt.js project | ||
## Build Setup | ||
|
||
``` bash | ||
# install dependencies | ||
$ yarn install | ||
|
||
# serve with hot reload at localhost:3000 | ||
$ yarn run dev | ||
|
||
# build for production and launch server | ||
$ yarn run build | ||
$ yarn start | ||
|
||
# generate static project | ||
$ yarn run generate | ||
``` | ||
|
||
For detailed explanation on how things work, checkout [Nuxt.js docs](https://nuxtjs.org). |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
const extendConfig = require('./webpack.config.extend') | ||
const pkg = require('./package') | ||
|
||
module.exports = { | ||
mode: 'universal', | ||
srcDir: 'src/', | ||
|
||
/* | ||
** Headers of the page | ||
*/ | ||
head: { | ||
title: pkg.name, | ||
meta: [ | ||
{ charset: 'utf-8' }, | ||
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }, | ||
{ hid: 'description', name: 'description', content: pkg.description } | ||
], | ||
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }] | ||
}, | ||
|
||
/* | ||
** Customize the progress-bar color | ||
*/ | ||
loading: { color: '#fff' }, | ||
|
||
/* | ||
** Global CSS | ||
*/ | ||
css: [], | ||
|
||
/* | ||
** Extensions | ||
*/ | ||
extensions: ['ts', 'js'], | ||
|
||
/* | ||
** Plugins to load before mounting the App | ||
*/ | ||
plugins: [], | ||
|
||
/* | ||
** Nuxt.js modules | ||
*/ | ||
modules: [], | ||
|
||
/* | ||
** Build configuration | ||
*/ | ||
build: { | ||
extend(config) { | ||
extendConfig(config) | ||
return | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "nuxt-ts-example", | ||
"version": "1.0.0", | ||
"description": "My praiseworthy Nuxt.js project", | ||
"author": "andoshin11", | ||
"private": true, | ||
"scripts": { | ||
"dev": "cross-env NODE_ENV=development nodemon src/server/index.js --watch server", | ||
"build": "nuxt build", | ||
"start": "cross-env NODE_ENV=production node src/server/index.js", | ||
"generate": "nuxt generate", | ||
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .", | ||
"precommit": "npm run lint" | ||
}, | ||
"dependencies": { | ||
"cross-env": "^5.2.0", | ||
"express": "^4.16.3", | ||
"nuxt": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^10.12.12", | ||
"babel-eslint": "^8.2.1", | ||
"eslint": "^5.0.1", | ||
"eslint-config-prettier": "^3.1.0", | ||
"eslint-loader": "^2.0.0", | ||
"eslint-plugin-prettier": "2.6.2", | ||
"eslint-plugin-vue": "^4.0.0", | ||
"nodemon": "^1.11.0", | ||
"prettier": "1.14.3", | ||
"ts-loader": "^5.3.1", | ||
"typescript": "^3.2.2" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# ASSETS | ||
|
||
**This directory is not required, you can delete it if you don't want to use it.** | ||
|
||
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<template> | ||
<div class="Calculator"> | ||
<input type="number" class="left" v-model="left"> | ||
<select name="operator" v-model="operator"> | ||
<option :value="Operators.ADD">+</option> | ||
<option :value="Operators.SUBTRACT">-</option> | ||
<option :value="Operators.MULTIPLE">*</option> | ||
<option :value="Operators.DEVIDE">/</option> | ||
</select> | ||
<input type="number" class="right" v-model="right"> | ||
<div class="answer">= {{ answer }}</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue' | ||
enum Operators { | ||
ADD, | ||
SUBTRACT, | ||
MULTIPLE, | ||
DEVIDE | ||
} | ||
interface IData { | ||
Operators: typeof Operators | ||
left: string | null | ||
right: string | null | ||
operator: Operators | ||
} | ||
export default Vue.extend({ | ||
data(): IData { | ||
return { | ||
Operators, | ||
left: null, | ||
right: null, | ||
operator: Operators.ADD | ||
} | ||
}, | ||
computed: { | ||
answer(): number { | ||
if (!this.left || !this.right) return 0 | ||
const left = Number(this.left) | ||
const right = Number(this.right) | ||
switch (this.operator) { | ||
case Operators.ADD: | ||
return left + right | ||
case Operators.SUBTRACT: | ||
return left - right | ||
case Operators.MULTIPLE: | ||
return left * right | ||
case Operators.DEVIDE: | ||
return left / right | ||
default: | ||
return 0 | ||
} | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<style scoped> | ||
.Calculator { | ||
display: flex; | ||
justify-content: center; | ||
margin-top: 16px; | ||
} | ||
input { | ||
border: solid 1px #ddd; | ||
margin: 0 8px; | ||
} | ||
</style> |
Oops, something went wrong.