我想创建一个2-D数组,其中第一维的行数可以在单击特定按钮时增加.
<script setup>
...
//if define the table like that:
var tab=ref([])
//this is the function called on the click
function addrow(){
tab.value.push()
...
}
</script>
我想创建一个2-D数组,其中第一维的行数可以在单击特定按钮时增加.
<script setup>
...
//if define the table like that:
var tab=ref([])
//this is the function called on the click
function addrow(){
tab.value.push()
...
}
</script>
不需要加引用,tab
‘S值已经是无功数组了,加一个数组就行了:
<script setup>
...
//if define the table like that:
var tab=ref([])
//this is the function called on the click
function addrow(){
tab.value.push([])
...
}
</script>