1+ <script setup>
2+ import { useStore } from ' ./store'
3+
4+ const store = useStore ()
5+ const run = store .run
6+ const runLots = store .runLots
7+ const add = store .add
8+ const update = store .update
9+ const clear = store .clear
10+ const swapRows = store .swapRows
11+ const select = store .select
12+ const remove = store .remove
13+ </script >
14+
15+ <template >
16+ <div class =" jumbotron" >
17+ <div class =" row" >
18+ <div class =" col-md-6" >
19+ <h1 >Vue.js 3 (keyed)</h1 >
20+ </div >
21+ <div class =" col-md-6" >
22+ <div class =" row" >
23+ <div class =" col-sm-6 smallpad" >
24+ <button
25+ type =" button"
26+ class =" btn btn-primary btn-block"
27+ id =" run"
28+ @click =" run"
29+ >
30+ Create 1,000 rows
31+ </button >
32+ </div >
33+ <div class =" col-sm-6 smallpad" >
34+ <button
35+ type =" button"
36+ class =" btn btn-primary btn-block"
37+ id =" runlots"
38+ @click =" runLots"
39+ >
40+ Create 10,000 rows
41+ </button >
42+ </div >
43+ <div class =" col-sm-6 smallpad" >
44+ <button
45+ type =" button"
46+ class =" btn btn-primary btn-block"
47+ id =" add"
48+ @click =" add"
49+ >
50+ Append 1,000 rows
51+ </button >
52+ </div >
53+ <div class =" col-sm-6 smallpad" >
54+ <button
55+ type =" button"
56+ class =" btn btn-primary btn-block"
57+ id =" update"
58+ @click =" update"
59+ >
60+ Update every 10th row
61+ </button >
62+ </div >
63+ <div class =" col-sm-6 smallpad" >
64+ <button
65+ type =" button"
66+ class =" btn btn-primary btn-block"
67+ id =" clear"
68+ @click =" clear"
69+ >
70+ Clear
71+ </button >
72+ </div >
73+ <div class =" col-sm-6 smallpad" >
74+ <button
75+ type =" button"
76+ class =" btn btn-primary btn-block"
77+ id =" swaprows"
78+ @click =" swapRows"
79+ >
80+ Swap Rows
81+ </button >
82+ </div >
83+ </div >
84+ </div >
85+ </div >
86+ </div >
87+ <table class =" table table-hover table-striped test-data" >
88+ <tbody >
89+ <tr
90+ v-for =" { id, label } of store.rows"
91+ :key =" id"
92+ :class =" { danger: id === store.selected }"
93+ :data-label =" label"
94+ v-memo =" [label, id === store.selected]"
95+ >
96+ <td class =" col-md-1" >{{ id }}</td >
97+ <td class =" col-md-4" >
98+ <a @click =" select(id)" >{{ label }}</a >
99+ </td >
100+ <td class =" col-md-1" >
101+ <a @click =" remove(id)" >
102+ <span class =" glyphicon glyphicon-remove" aria-hidden =" true" ></span >
103+ </a >
104+ </td >
105+ <td class =" col-md-6" ></td >
106+ </tr >
107+ </tbody >
108+ </table >
109+ <span
110+ class =" preloadicon glyphicon glyphicon-remove"
111+ aria-hidden =" true"
112+ ></span >
113+ </template >
0 commit comments