some test code and playing around
This commit is contained in:
@ -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
|
||||
}
|
Reference in New Issue
Block a user