fix: 修复点击卖出输入框时positions为空的报错

This commit is contained in:
claw_bot 2026-03-10 04:12:06 +00:00
parent b400c4646d
commit e44b4bc0a6

View File

@ -166,7 +166,7 @@
:placeholder="transactionType === 'sell' ? '请选择要卖出的持仓' : '请输入股票代码'" :placeholder="transactionType === 'sell' ? '请选择要卖出的持仓' : '请输入股票代码'"
:disabled="transactionType === 'sell'" :disabled="transactionType === 'sell'"
@input="transactionType === 'buy' ? searchStock(e.detail.value) : () => {}" @input="transactionType === 'buy' ? searchStock(e.detail.value) : () => {}"
@click="transactionType === 'sell' ? (searchResults.length = positions.value.map(pos => ({ @click="transactionType === 'sell' ? (searchResults = (positions.value || []).map(pos => ({
ticker: pos.stockCode, ticker: pos.stockCode,
stockName: pos.stockName, stockName: pos.stockName,
assetType: pos.assetType || 'Stock', assetType: pos.assetType || 'Stock',