我正在尝试显示收到的带有索引和总数的网络套接字消息。如何动态显示总计?
Function Excel-Write{
$RD = "C:\temp\Servers\*.csv"
$CsvDir = $RD
$csvs = dir -path $CsvDir
$outputxls = ""C:\temp\Servers\Complete.Xlsx"
foreach($iCsv in $csvs){
$WB = $csvs.Length
$Excel = New-Object -ComObject excel.application
#$Excel.displayAlerts = $false
$workbook = $excel.Workbooks.add(1)
$Worksheet = $workbook.worksheets.Item(1)
$Worksheet.name = $Group
$TxtConnector = ("TEXT;" + $iCsv)
$Connector = $worksheet.Querytables.add($txtconnector,$worksheet.Range("A1"))
$query = $Worksheet.QueryTables.item($Connector.name)
$query.TextfileOtherDelimiter = $Excel.Application.International(5)
$Query.TextfileParseType =1
$Query.TextFileColumnDataTypes = ,2 * $worksheet.cells.column.count
$query.AdjustColumnWidth =1
$Query.Refresh()
$Query.Delete()
$workbook.Save()
}
$Workbook.SaveAs($outputxls,51)
$Excel.quit()
}
答案 0 :(得分:1)
您只需要使用Computed Property:
export default {
data() {
return {
logs: []
};
},
computed: {
total() {
return this.logs.length;
}
},
...
}
答案 1 :(得分:1)