mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
some test code and playing around
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
# vue
|
||||
|
||||
## Project setup
|
||||
```
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
yarn serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
yarn build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
@@ -33,7 +33,9 @@
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint"
|
||||
},
|
||||
"rules": {}
|
||||
"rules": {
|
||||
"no-unused-vars": "off"
|
||||
}
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<HelloWorld msg="Welcome to Your Vue.js App"/>
|
||||
<HelloWorld msg="Test"/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
<template>
|
||||
<div class="hello">
|
||||
<h1>{{ msg }}</h1>
|
||||
|
||||
{{ text }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {myCustomTestFunction} from "@/utils";
|
||||
|
||||
export default {
|
||||
name: 'HelloWorld',
|
||||
data() {
|
||||
return {
|
||||
text: ''
|
||||
}
|
||||
},
|
||||
props: {
|
||||
msg: String
|
||||
},
|
||||
mounted() {
|
||||
this.text = myCustomTestFunction("Neuer Text")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
14
vue/src/components/TestComponent.vue
Normal file
14
vue/src/components/TestComponent.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<div class="hello">
|
||||
<h1>{{ msg }}</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'TestComponent',
|
||||
props: {
|
||||
msg: String
|
||||
}
|
||||
}
|
||||
</script>
|
||||
3
vue/src/test.js
Normal file
3
vue/src/test.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export function myOtherTestFunction(n) {
|
||||
return n
|
||||
}
|
||||
9
vue/src/utils.js
Normal file
9
vue/src/utils.js
Normal file
@@ -0,0 +1,9 @@
|
||||
export {myOtherTestFunction} from './test.js'
|
||||
|
||||
import TestComponent from './components/TestComponent'
|
||||
|
||||
|
||||
export function myCustomTestFunction(x) {
|
||||
console.log(x)
|
||||
return x
|
||||
}
|
||||
@@ -5,6 +5,10 @@ const pages = {
|
||||
entry: './src/main.js',
|
||||
chunks: ['chunk-vendors']
|
||||
},
|
||||
'util': {
|
||||
entry: './src/utils.js',
|
||||
chunks: ['chunk-vendors']
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"status":"done","chunks":{"chunk-vendors":[{"name":"js/chunk-vendors.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\chunk-vendors.js"}],"vue_app_01":[{"name":"css/vue_app_01.css","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\css\\vue_app_01.css"},{"name":"js/vue_app_01.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\vue_app_01.js"}]}}
|
||||
{"status":"done","publicPath":"http://localhost:8080/","chunks":{"chunk-vendors":[{"name":"js/chunk-vendors.js","publicPath":"http://localhost:8080/js/chunk-vendors.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\chunk-vendors.js"}],"util":[{"name":"js/util.js","publicPath":"http://localhost:8080/js/util.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\util.js"}],"vue_app_01":[{"name":"js/vue_app_01.js","publicPath":"http://localhost:8080/js/vue_app_01.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\vue_app_01.js"},{"name":"vue_app_01.3d20274fdb25a102c86d.hot-update.js","publicPath":"http://localhost:8080/vue_app_01.3d20274fdb25a102c86d.hot-update.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\vue_app_01.3d20274fdb25a102c86d.hot-update.js"}]},"error":"ModuleError","message":"Module Error (from ./node_modules/eslint-loader/index.js):\n\nF:\\Developement\\Django\\recipes\\vue\\src\\components\\HelloWorld.vue\n 17:5 error Unexpected mutation of \"msg\" prop vue/no-mutating-props\n\n✖ 1 problem (1 error, 0 warnings)\n"}
|
||||
Reference in New Issue
Block a user