vuejs2 - 为什么,当您在 v-select 之外单击时,v-model 会重置为 null?验证
问题描述
此错误出现在带有 Vuetify 1.5.14 和 Vue 2.x 的 IE11 中。我正在使用 v-select 组件,如下所示:
form#login-form
v-select#inputTypeDocument(:items = 'type_documents' required v-model='form.typeDocument' placeholder='Type of document')
export default {
data () {
return {
form: {
typeDocument: 2,
numberDocument: '',
password: ''
},
type_documents: [
{text: 'Type 1', value: 1},
{text: 'Type 2', value: 2}
]
}
}
}
并且在IE11中测试,当你改变v-select的值并点击组件外部或者按tab时,v-model的值被重置为null。而且我还有其他行为相同的 v-select。
在我的 main.js 文件中,我有如下 polyfill:
import 'babel-polyfill'
import Vue from 'vue'
import App from './App'
import axios from 'axio
[..]
在 IE11 中使用 v-select 组件是否有解决此问题的方法?
解决方案
即使使用这个“修复”——你可能在使用Vuetify
IE11 时遇到更多麻烦。 Vuetify
已知不适用于 IE11..
注意:我还必须babel-polyfill
与这个“修复”一起使用..
话虽如此,我已经测试/验证了这个“修复”:
<v-select id="input"
:items="type_documents"
required
v-model="form.typeDocument"
:placeholder="form.typeDocument ? undefined : 'Type of document'">
</v-select>
具体来说,这一行:
:placeholder="form.typeDocument ? undefined : 'Type of document'">
推荐阅读
- dijkstra - 有兴趣通过dijkstra算法在opl cplex中找到k个最短路径
- powershell - 有没有办法在powershell中运行ossec win32ui
- solr - Solr edismax 查询语法错误“查询字段'_text_'不是有效的字段名称”
- tensorflow - Raspberry Pi 安装 Tensor-flow 和 Keras
- react-native - React Native Google Login(错误:发生不可恢复的登录失败)
- neural-network - 辍学可以提高训练数据的性能吗?
- security - 使用 WebAuthN 可以拒绝某些类型的身份验证方法 FIDO2)
- python - 使用 Python 生成循环二维码,如信使或 kik 代码
- sql - 在另一列中查找具有最不同值的列?
- c# - 在页面加载时调用两个 fullTrust 应用程序时出错