ldc-lionor/resources/ts/fo/components/ComposantFrontTestComponent.vue
Sebastien Hattry 68c9a5d61e integration 1
2023-03-09 10:27:19 +00:00

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>