File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,17 @@ export const Controlls: StoryObj = {
125125 />
126126 prepend
127127 </ label >
128+ < button
129+ onclick = { ( ) => {
130+ setData ( ( prev ) => {
131+ const items = [ ...prev ] ;
132+ items . pop ( ) ;
133+ return items ;
134+ } ) ;
135+ } }
136+ >
137+ pop
138+ </ button >
128139 </ div >
129140 < VList
130141 ref = { ( h ) => {
Original file line number Diff line number Diff line change 4848 />
4949 prepend
5050 </label >
51+ <button
52+ onclick ={() => {
53+ const items = [... data ];
54+ items .pop ();
55+ data = items ;
56+ }}>pop</button
57+ >
5158 </div >
5259 <VList
5360 bind:this ={ref }
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ const append = () => {
2424 ? [... items , ... data .value ]
2525 : [... data .value , ... items ];
2626};
27+ const pop = () => {
28+ const items = [... data .value ];
29+ items .pop ();
30+ data .value = items ;
31+ };
2732 </script >
2833
2934<template >
@@ -48,6 +53,7 @@ const append = () => {
4853 <input type =" checkbox" v-model =" prepend" />
4954 prepend</label
5055 >
56+ <button @click =" pop" >pop</button >
5157 </div >
5258 <VList
5359 ref =" handle"
You can’t perform that action at this time.
0 commit comments