s6e104 communication problems
This commit is contained in:
parent
f19dc139aa
commit
f693ad8506
5
section-code/.babelrc
Normal file
5
section-code/.babelrc
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"presets": [
|
||||
["es2015", { "modules": false }]
|
||||
]
|
||||
}
|
18
section-code/README.md
Normal file
18
section-code/README.md
Normal file
@ -0,0 +1,18 @@
|
||||
# vue-cli
|
||||
|
||||
> A Vue.js project
|
||||
|
||||
## Build Setup
|
||||
|
||||
``` bash
|
||||
# install dependencies
|
||||
npm install
|
||||
|
||||
# serve with hot reload at localhost:8080
|
||||
npm run dev
|
||||
|
||||
# build for production with minification
|
||||
npm run build
|
||||
```
|
||||
|
||||
For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
|
13
section-code/index.html
Normal file
13
section-code/index.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Vue Components</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
</div>
|
||||
<script src="/dist/build.js"></script>
|
||||
</body>
|
||||
</html>
|
25
section-code/package.json
Normal file
25
section-code/package.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "vue-cli",
|
||||
"description": "A Vue.js project",
|
||||
"author": "Maximilian Schwarzmüller <mblacky0@gmail.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --inline --hot",
|
||||
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"bootstrap": "^3.3.7",
|
||||
"vue": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.0.0",
|
||||
"babel-loader": "^6.0.0",
|
||||
"babel-preset-es2015": "^6.0.0",
|
||||
"cross-env": "^3.0.0",
|
||||
"css-loader": "^0.25.0",
|
||||
"file-loader": "^0.9.0",
|
||||
"vue-loader": "^9.7.0",
|
||||
"webpack": "2.1.0-beta.25",
|
||||
"webpack-dev-server": "2.1.0-beta.0"
|
||||
}
|
||||
}
|
26
section-code/src/App.vue
Normal file
26
section-code/src/App.vue
Normal file
@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<app-user></app-user>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import User from './components/User.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
appUser: User
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
div.component {
|
||||
border: 1px solid black;
|
||||
padding: 30px;
|
||||
}
|
||||
</style>
|
BIN
section-code/src/assets/logo.png
Normal file
BIN
section-code/src/assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
44
section-code/src/components/User.vue
Normal file
44
section-code/src/components/User.vue
Normal file
@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<div class="component">
|
||||
<h1>The User Component</h1>
|
||||
<p>I'm an awesome User!</p>
|
||||
<button @click="changeName">Change My Name</button>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<app-user-detail></app-user-detail>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<app-user-edit></app-user-edit>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UserDetail from './UserDetail.vue';
|
||||
import UserEdit from './UserEdit.vue';
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
name: "Tyrel",
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeName(){
|
||||
this.name = "TyrelSouza"
|
||||
},
|
||||
},
|
||||
components: {
|
||||
appUserDetail: UserDetail,
|
||||
appUserEdit: UserEdit
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
div {
|
||||
background-color: lightblue;
|
||||
}
|
||||
</style>
|
19
section-code/src/components/UserDetail.vue
Normal file
19
section-code/src/components/UserDetail.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div class="component">
|
||||
<h3>You may view the User Details here</h3>
|
||||
<p>Many Details</p>
|
||||
<p>User Name: {{ name }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
div {
|
||||
background-color: lightcoral;
|
||||
}
|
||||
</style>
|
15
section-code/src/components/UserEdit.vue
Normal file
15
section-code/src/components/UserEdit.vue
Normal file
@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<div class="component">
|
||||
<h3>You may edit the User here</h3>
|
||||
<p>Edit me!</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
div {
|
||||
background-color: lightgreen;
|
||||
}
|
||||
</style>
|
7
section-code/src/main.js
Normal file
7
section-code/src/main.js
Normal file
@ -0,0 +1,7 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
render: h => h(App)
|
||||
})
|
64
section-code/webpack.config.js
Normal file
64
section-code/webpack.config.js
Normal file
@ -0,0 +1,64 @@
|
||||
var path = require('path')
|
||||
var webpack = require('webpack')
|
||||
|
||||
module.exports = {
|
||||
entry: './src/main.js',
|
||||
output: {
|
||||
path: path.resolve(__dirname, './dist'),
|
||||
publicPath: '/dist/',
|
||||
filename: 'build.js'
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue',
|
||||
options: {
|
||||
// vue-loader options go here
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel',
|
||||
exclude: /node_modules/
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpg|gif|svg)$/,
|
||||
loader: 'file',
|
||||
options: {
|
||||
name: '[name].[ext]?[hash]'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'vue$': 'vue/dist/vue'
|
||||
}
|
||||
},
|
||||
devServer: {
|
||||
historyApiFallback: true,
|
||||
noInfo: true
|
||||
},
|
||||
devtool: '#eval-source-map'
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports.devtool = '#source-map'
|
||||
// http://vue-loader.vuejs.org/en/workflow/production.html
|
||||
module.exports.plugins = (module.exports.plugins || []).concat([
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
||||
}),
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
minimize: true
|
||||
})
|
||||
])
|
||||
}
|
4206
section-code/yarn.lock
Normal file
4206
section-code/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user