动态显示数组长度

时间:2019-01-22 08:57:13

标签: vue.js websocket

我正在尝试显示收到的带有索引和总数的网络套接字消息。如何动态显示总计?

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()
} 

2 个答案:

答案 0 :(得分:1)

您只需要使用Computed Property

export default {
  data() {
    return {
      logs: []
    };
  },
  computed: {
    total() {
      return this.logs.length;
    }
  },
  ...
}

答案 1 :(得分:1)

您在那里不需要计算属性。您可以简单地使用php artisan storage:link 而不是总计

这是一个小提琴样本

https://jsfiddle.net/czgnv53q/3/