fix: 卖出时输入框改用disabled禁止编辑,点击自动展开持仓列表
This commit is contained in:
parent
b523346eaf
commit
b400c4646d
@ -164,9 +164,16 @@
|
|||||||
v-model="transactionForm.stockCode"
|
v-model="transactionForm.stockCode"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
:placeholder="transactionType === 'sell' ? '请选择要卖出的持仓' : '请输入股票代码'"
|
:placeholder="transactionType === 'sell' ? '请选择要卖出的持仓' : '请输入股票代码'"
|
||||||
:readonly="transactionType === 'sell'"
|
:disabled="transactionType === 'sell'"
|
||||||
@input="transactionType === 'buy' ? searchStock(e.detail.value) : () => {}"
|
@input="transactionType === 'buy' ? searchStock(e.detail.value) : () => {}"
|
||||||
@click="transactionType === 'sell' && searchResults.length > 0 ? () => {} : () => {}"
|
@click="transactionType === 'sell' ? (searchResults.length = positions.value.map(pos => ({
|
||||||
|
ticker: pos.stockCode,
|
||||||
|
stockName: pos.stockName,
|
||||||
|
assetType: pos.assetType || 'Stock',
|
||||||
|
currency: pos.currency,
|
||||||
|
amount: pos.amount,
|
||||||
|
exchange: ''
|
||||||
|
}))) : () => {}"
|
||||||
/>
|
/>
|
||||||
<!-- 搜索下拉列表/持仓列表 -->
|
<!-- 搜索下拉列表/持仓列表 -->
|
||||||
<view class="search-dropdown" v-if="searchResults.length > 0">
|
<view class="search-dropdown" v-if="searchResults.length > 0">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user