---
# System prepended metadata

title: code

---

# code
            <div class="tab-content" id="nav-tabContent">
                    <div class="tab-pane" :class="{ active :true }">
                        <div class="all-the-color">
                            <template v-for="[category, colorData] in colorList" >

                                <div class="card" v-for="(item,index) in colorData.list" :key="item.timestamp" v-show="tabCategory==category">
                                    <template v-if="editing == item ">
                                        <div class="color-box-editing" :style="{ 'background-color': `rgb(${this.editingColorRed}, ${this.editingColorGreen}, ${this.editingColorBlue})`}"></div>
                                        <div class="card-body-editing">
                                            <label for="category">Category:<input id="category" type="text" placeholder="Category" :value="editedCategory" @input="$emit('update:editedCategory', $event.target.value)" required /></label>
                                            <label for="red">Red：<input id="red" type="number" placeholder="Max with three numbers" maxlength="3" :value="editedRed" @input="$emit('update:editedRed', $event.target.value)" required /></label>
                                            <label for="green">Green：<input id="green" type="number" placeholder="Max with three numbers" maxlength="3" :value="editedGreen" @input="$emit('update:editedGreen', $event.target.value)" required /></label>
                                            <label for="blue">Blue： <input id="blue" type="number" placeholder="Max with three numbers" maxlength="3" :value="editedBlue" @input="$emit('update:editedBlue', $event.target.value)" required /></label>
                                            <button class="btn" @click="completeColorItem">Confirm</button>
                                            <button class="btn" @click="editingCancel">Cancel</button>
                                        </div>
                                    </template>
                                    <template v-else>
                                        <div class="color-box" :style="{ 'background-color': `rgb(${item.red}, ${item.green}, ${item.blue})`}"></div>
                                        <div class="card-body">
                                            <p>{{ item.category }}</p>
                                            <p>Red：{{ item.red }}</p>
                                            <p>Green：{{ item.green }}</p>
                                            <p>Blue：{{ item.blue }}</p>
                                            <button class="btn" @click="editColor(item)">edit</button>
                                            <button class="btn" @click="deleteColor(item)">delete</button>
                                        </div>
                                    </template>
                                </div>
                            </template>
                        </div>
                    </div>
                </div>