create-nodality-vue 1.0.0-beta.7 → 1.0.0-beta.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +1 -1
- package/package.json +1 -1
- package/templates/src/App.vue +33 -14
- package/templates/src/components/HelloWorld.vue +2 -2
package/bin/index.js
CHANGED
package/package.json
CHANGED
package/templates/src/App.vue
CHANGED
@@ -1,24 +1,43 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
<HelloWorld :text="textInstance" v-model:msg="welcomeMessage" />
|
2
|
+
<HelloWorld :text="textInstance" v-model:msg="welcomeMessage"/>
|
4
3
|
</template>
|
5
4
|
|
6
5
|
<script>
|
7
|
-
import HelloWorld from
|
8
|
-
import {
|
9
|
-
|
6
|
+
import HelloWorld from './components/HelloWorld.vue'
|
7
|
+
import {Text} from "nodality";
|
10
8
|
export default {
|
9
|
+
name: 'App',
|
10
|
+
components: {
|
11
|
+
HelloWorld
|
12
|
+
},
|
13
|
+
|
14
|
+
watch: {
|
15
|
+
// Watch for changes to welcomeMessage and recreate the instance
|
16
|
+
welcomeMessage() {
|
17
|
+
console.log(this.welcomeMessage) // THIS WORKS
|
18
|
+
this.textInstance = new Text(this.welcomeMessage).set({ size: "S1", color: "#1abc9c" });
|
19
|
+
},
|
20
|
+
},
|
11
21
|
data() {
|
12
22
|
return {
|
13
|
-
welcomeMessage: "Welcome to
|
14
|
-
|
15
|
-
}
|
23
|
+
welcomeMessage: "Welcome to Your Vue.js App", // Define a reactive property
|
24
|
+
textInstance: null
|
25
|
+
}
|
16
26
|
},
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
color: "#1abc9c",
|
21
|
-
});
|
27
|
+
created() {
|
28
|
+
// Initialize the Text instance when the component is created
|
29
|
+
this.textInstance = new Text(this.welcomeMessage).set({ size: "S1", color: "#1abc9c" });
|
22
30
|
},
|
23
|
-
}
|
31
|
+
}
|
24
32
|
</script>
|
33
|
+
|
34
|
+
<style>
|
35
|
+
#app {
|
36
|
+
font-family: Avenir, Helvetica, Arial, sans-serif;
|
37
|
+
-webkit-font-smoothing: antialiased;
|
38
|
+
-moz-osx-font-smoothing: grayscale;
|
39
|
+
text-align: center;
|
40
|
+
color: #2c3e50;
|
41
|
+
margin-top: 60px;
|
42
|
+
}
|
43
|
+
</style>
|
@@ -1,6 +1,5 @@
|
|
1
1
|
<script setup>
|
2
2
|
import { useTemplateRef, onMounted, defineProps, defineEmits, watch } from 'vue'
|
3
|
-
//import {Text} from "../lib/TextCopy.js";
|
4
3
|
|
5
4
|
// Define props to accept the msg value
|
6
5
|
const props = defineProps({
|
@@ -33,5 +32,6 @@ function updateMessage(event) {
|
|
33
32
|
</script>
|
34
33
|
|
35
34
|
<template>
|
36
|
-
|
35
|
+
<input ref="my-input" :value="msg" @input="updateMessage" />
|
36
|
+
<div ref="my-comp"/>
|
37
37
|
</template>
|