You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.5 KiB
JavaScript
65 lines
1.5 KiB
JavaScript
2 years ago
|
export default {
|
||
2 years ago
|
name: "CookbookForm",
|
||
|
setup() {
|
||
|
const { ref } = Vue;
|
||
|
|
||
|
const title = ref("");
|
||
|
const description = ref("");
|
||
|
const nature = ref("");
|
||
|
const logs = ref([""]);
|
||
|
const who = ref("");
|
||
|
|
||
|
return { title, description, nature, logs, who };
|
||
|
},
|
||
|
template: `
|
||
2 years ago
|
<section class='recipe'>
|
||
|
<div class="entry">
|
||
|
<label for="title">Title</label>
|
||
|
<input type="text" v-model='title'/>
|
||
|
</div>
|
||
2 years ago
|
|
||
2 years ago
|
<div class="entry">
|
||
|
<label for="description">Description</label>
|
||
|
<textarea v-model="description"></textarea>
|
||
|
</div>
|
||
2 years ago
|
|
||
2 years ago
|
<div class="entry">
|
||
|
<label for="nature">Nature of the input</label>
|
||
|
<input type="text" v-model="nature" />
|
||
|
</div>
|
||
2 years ago
|
|
||
2 years ago
|
<div class="entry">
|
||
|
<label for="log">Process Log</label>
|
||
|
<textarea v-model="logs[index]" v-for="(log, index) in logs" :key="index" :placeholder="index + 1"></textarea>
|
||
|
<button class="add" @click="logs.push('')">+</button>
|
||
|
</div>
|
||
2 years ago
|
|
||
2 years ago
|
<div class="entry">
|
||
|
<label for="who">Who</label>
|
||
|
<input type="text" v-model="who" />
|
||
|
</div>
|
||
|
</section>
|
||
2 years ago
|
|
||
|
<dl>
|
||
|
<dt>Title</dt>
|
||
|
<dd>{{title}}</dd>
|
||
|
|
||
|
<dt>Description</dt>
|
||
|
<dd>{{description}}</dd>
|
||
|
|
||
|
<dt>Nature</dt>
|
||
|
<dd>{{nature}}</dd>
|
||
|
|
||
|
<dt>Log</dt>
|
||
|
<dd>
|
||
2 years ago
|
<ol>
|
||
2 years ago
|
<li v-for="log in logs">{{log}}</li>
|
||
2 years ago
|
</ol>
|
||
2 years ago
|
</dd>
|
||
|
|
||
|
<dt>Who</dt>
|
||
|
<dd>{{who}}</dd>
|
||
|
</dl>
|
||
|
`,
|
||
|
};
|