<b-form-file>在切换到其他组件时不保持文件名可见

问题描述

我是Vue的新手,正在为表单使用Bootstrap视图。 我正在使用b-form-file上载组件Component2.vue中的文件,并且能够浏览本地文件系统并选择文件。选择后,在b-form-file中可以看到文件名。 当我通过UI访问另一个组件(Component1.vue)并返回到Component2.vue时,文件名在浏览器中不再可见。尽管我已经使用v-model将其绑定到文件,并且发生了绑定,但是文件名未显示在b-form-file中。

我想让文件名在b-form-file中保持可见,因为它在整个会话中都绑定到“文件”。 我正在像这样使用b-form-file:

<form>
  <b-form-file
    id="form-model"
    v-model="file"
    required
    placeholder="Choose a model..."
  ></b-form-file>
<form>

<script>
export default {
  data() {
    return { file: null }
  }
}
</script>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)