46 lines
902 B
Vue
46 lines
902 B
Vue
<template>
|
|
<button @click="inTValue.push(String(Math.ceil(Math.random() * 100)))">
|
|
Ajouter
|
|
</button>
|
|
<div
|
|
class="testComponent"
|
|
v-for="(line, indexLine) of inTValue"
|
|
:key="indexLine"
|
|
>
|
|
<ul class="list-group">
|
|
<li class="list-group-item">
|
|
<span class="h4">{{ indexLine }}</span><strong>{{ line }}</strong>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent } from "vue";
|
|
|
|
export default defineComponent({
|
|
mounted() {
|
|
const json = String(this.$attrs.json ?? "{}"),
|
|
data = JSON.parse(json);
|
|
this.inTid = String(data.id);
|
|
this.inTValue = data.value;
|
|
},
|
|
data(): {
|
|
inTid: string;
|
|
inTValue: Array<string>;
|
|
} {
|
|
return {
|
|
inTid: "",
|
|
inTValue: [],
|
|
};
|
|
},
|
|
watch: {},
|
|
methods: {},
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.testComponent {
|
|
background-color: #f1f1f1;
|
|
}
|
|
</style>
|