- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试使用 Vuetify 的 v-text-field
autofocus
但是它只在第一次使用。关闭对话框后,它就不再起作用了。
这就是我想要做的:
<v-text-field ref="focus" autofocus></v-text-field>
在谷歌搜索时我发现它是一个 bug这在某些版本中已修复,但他们有我也尝试过的临时解决方案:
watch: {
dialog: (val) ->
if !val
debugger
requestAnimationFrame( =>
@$refs.focus.focus()
)
}
我是做错了什么还是仍然是一个错误?设置断点我看到它在那一点停止。谁能引导我走向正确的方向?
唯一的区别是我使用的是 Vuex 并且对话框变量在 Vuex 存储中。对话框是 getter/setter。
dialog:
get: ->
return this.$store.state.my_store.isDialogOpen
set: (value) ->
this.$store.commit('my_store/MY_MUTATION', value)
最佳答案
唯一对我有用的是 v-if="dialog"
因为 autofocus Prop 只能在初始加载时工作,这就是为什么它只在我第一次打开时可用对话框。
因此在对话框中使用自动对焦的工作 v-tex-field 看起来像这样:
<v-text-field v-if="dialog" label="Label" autofocus></v-text-field>
关于javascript - Vuetify 的自动对焦仅适用于第一个模式打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51472947/
有没有办法覆盖 Vuetify carousel 下一个/上一个图标上的样式?我看到有些字段可以使用自定义字段,但我想保留默认的 $vuetify.icons.next 并只更改其颜色。 最佳答案 在
我想要一个 option group (如 this )在 vuetify select 上. 那可能吗?如果是,我该怎么做? 最佳答案 过时 :请参阅下面的@DevNik 答案以了解正确实现 您可以
使用 vuetify expanded table但展开箭头在左侧显示为第一项。我怎样才能最后显示它(右侧),如 Expandable rows 所示例子?
我是 Vuetify 的新手(有史以来的第一个项目),我正在尝试在列粘性顶部内设置一张卡片。不幸的是没有按预期工作。我也尝试使用 vue-sticky-directive 中的 v-scroll 指令
我的 vuetify v-data-table 有很多列。现在它会自动压缩到屏幕尺寸。而不是我想要的是向我的 v-data-tale 添加水平滚动条。之前在 1.5 版中存在,但在版本 2 中不存在。
我从 Vuetify 导入了数据表组件,除了 Rows per page 部分之外,它工作正常。它不会打开应包含 [5, 10, 20] 的列表来重新组织数据表。 照片中的更新这是错误,选项列表显示在
怎么设置vuetify嵌套列表默认关闭?文档示例显示了嵌套列表功能,但在添加到应用程序时默认情况下会打开嵌套列表。 https://vuetifyjs.com/en/components/naviga
我知道这个问题 change-default-font-in-vuetify在 SO,但它没有解决我的问题,因为它是在 vue-cli-3 出现之前发布的,所以那里的想法在这里并不适用,官方文档来自
我正在使用 nuxt.js 和 vuetify 创建一个网站,我想将 bool 复选框文本的颜色更改为黑色,默认情况下为白色,请参阅 here !我怎样才能改变颜色? 我已经尝试过使用类 black-
我正在使用 nuxt.js 和 vuetify 创建一个网站,我想将 bool 复选框文本的颜色更改为黑色,默认情况下为白色,请参阅 here !我怎样才能改变颜色? 我已经尝试过使用类 black-
以前(我认为?)可以将 HTML 放入 vuetify 提示中,但对我来说这不再有效。例如,在我的一个组件中我有: Red hint" /> 此提示以前显示为红色,但现在我看到了完整的 HTML 代码
当 v-data-table 在移动 View 上时,项目之间的分隔线不清晰。如何自定义此分隔线,例如线宽和颜色? 我想做的: Custom divider on mobile view 来自 vue
我想整体更改数据表的背景颜色。我不想使用深色主题或浅色主题。即使使用 !important 或使用可用类,我似乎也无法更改它。 最佳答案 只需添加相关的颜色类,例如class="primary"或 v
我正在尝试将对话框和 snackbar 的使用与 VueJS 结合起来。问题如下: 预期行为: 我应该能够在不关闭对话框的情况下关闭 snackbar 现在发生了什么: 单击 snackbar 时正在
如果不使用 vuetify fork,我无法找到一个好的解决方案,它不稳定并且无论如何似乎都是旧版本。我会在评论中链接到它。 我能想到的唯一方法是将两个数据表并排排列,这本身就会产生问题。我知道还有其
我需要一个 v-text-field用户可以在其中输入他们通过短信收到的确认码。即使用户没有写大写字母的意图,该字段的内容也应该全部自动转换为大写字母。 最佳答案 您可以使用 keyup事件大写是这样
我正在尝试创建一个搜索输入字段,其中包含下拉列表中先前搜索的历史记录,例如 Intellij 编辑器中的搜索字段。 我是 Vuetify 的新手,从我目前看到的情况来看,Combobox 是最好的组件
v-select允许添加append-outer-icon,但是如何在点击该项时强制展开图标列表? @click:append-outer 允许添加回调函数,但我在 openSelect 中做了什
我的代码是这样的: OK 演示是这样的:https://codepen.io/positivethinking639/pen/GRRNzVE?
单击(例如)此页面上的任何 CodePen 链接:https://vuetifyjs.com/en/components/navigation-drawers 注意无样式内容的闪光。你如何消除这个?
我是一名优秀的程序员,十分优秀!