【发布时间】:2021-02-22 17:29:32
【问题描述】:
在我们的网站上,我们正在使用 toast,至少我们想要这样做。该网站使用 bootstrap-vue 来展示 toast。 这适用于我的开发机器,一旦我将它推送到我们的服务器(S3 存储桶),吐司就不会弹出。当我检查网站时,我可以看到 toast 在那里,但是在网站上只有应该在 toast 的空白区域,没有显示任何文本。
这就是我对吐司的称呼:
created() {
const id = '1'
const vNodesMsg = this.$createElement(
'p',
{ class: ['text-left', 'text-charcoal'] },
[
this.$createElement(
'strong',
'This is the message the user will see when he gets to this page'
),
this.$createElement(
'b-button',
{
on: { click: () => this.$bvToast.hide(id) }
},
'Close'
)
]
)
this.$bvToast.toast([vNodesMsg], {
id,
noCloseButton: true,
noAutoHide: true,
toaster: 'b-toaster-bottom-full',
isStatus: true,
solid: false,
appendToast: false,
variant: 'secondary',
visible: true
})
},
在我的机器上检查网站后,我发现代码没有任何区别。除了显示吐司。
我能做什么?
非常感谢任何帮助。
要详细说明:
npm run dev
然后去 localhost:3000 工作。
npm run build
serve -s dist
然后转到 localhost:5000 不工作。
将 dist 文件夹复制到我们的服务器并调用网站也不起作用。这并不奇怪。
可能是我的配置中缺少某些东西吗?
谢谢,
迈克尔
【问题讨论】:
标签: toast bootstrap-vue