我有两个输入存储来自谷歌地图脚本的 lat 和 lng,如果用户更改标记的位置 => 这两个输入获取用户啄的 lat 和 lng,所以我想获取这两个输入的值,我试过 v -model 但它不起作用我实际上注意到只有当我通过键入或粘贴某些内容来更改这些输入的值时才会触发 v-model。有没有办法获得这些输入的值(例如-更改)到我的 Vue 实例?
从该数组中选中多个复选框后,如何禁用该数组?在vuejs中有没有办法做到这一点,或者我需要一个观察者?实际上,我尝试观看“ ord.sauce”,但无法使其正常工作
这是组件
Vue.component('sauce-view', {
props: ["sauce", "ord", "name"],
template: '
<div class="">
<input type="checkbox" :name="name" :value="sauce.id" v-model="ord.sauce">
{{sauce.name}}
<label >
<img :src="sauce.link" >
</label>
</div>',
});
Run Code Online (Sandbox Code Playgroud)
这是HTML
<table>
<tr v-for="o in order" >
{{o.sauce}}
<td v-for="sauce in les_sauces" >
<sauce-view :sauce="sauce" :ord="o" :name="o.produit+o.num">
</sauce-view>
</td>
</tr></table>
Run Code Online (Sandbox Code Playgroud) 我的UITableView中有一个问题data: [(gamme: String, [(product: String, quantity: Double)])],一切正常:插入行和部分,删除行和部分,重新加载.但有时当我尝试以快速方式删除许多行时(通过滑动表格并点击( - )逐行).它会导致像屏幕截图中的崩溃一样.
这个问题很难在开发应用程序中重现.但我的客户仍然报告它.我的客户是专业人士(不是普通用户),并希望以快速的方式使用中型到大型数据.
这是我删除行的函数:
override func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
let delete = UITableViewRowAction(style: .destructive, title: "-") { (action, indexPath) in
let cmd = self.groupedData[indexPath.section].1.remove(at: indexPath.row)
tableView.deleteRows(at: [indexPath], with: .right)
self.delegate?.didDeleteCmdLine(cmd)
if self.groupedData[indexPath.section].1.count == 0 {
self.groupedData.remove(at: indexPath.section)
tableView.deleteSections(IndexSet(integer: indexPath.section), with: UITableViewRowAnimation.right)
}
}
return [delete]
}
Run Code Online (Sandbox Code Playgroud)
为什么会这样?
这是崩溃的xcode组织者屏幕
检查是否groupedData由@Reinhard提出的主要线程以外的任何线程访问:
private var xgroupedData = [(gamme: GammePrdCnsPrcpl, [cmdline])]()
private var groupedData: [(gamme: GammePrdCnsPrcpl, [cmdline])] …Run Code Online (Sandbox Code Playgroud)