如何在VUE中为每个渲染组件添加自定义范围ID

发布于 2025-02-12 05:08:03 字数 608 浏览 0 评论 0原文

嗨,我有一个情况,例如我想从不同服务器下载css文件,其CSS将范围内附加了范围,如下所示。

[带有范围ID data-V-98b365f2>]的CSS - 组件dell dell

.Dell[data-v-98b365f2]{
    ........
}

附加到head,上述CSS文件

现在在我的Vue

import Dell from './Dell.vue';
export default{
    name:'Main-Component',
    component:{Dell}, <-- here i want to attach above scope-id of downloaded css file i,e data-v-98b365f2
}

问题:如何在我的情况下使用给定范围ID渲染组件data-v-98b365f2

注意:我下载的文件范围ID即使改变我会得到它,也永远不会改变。

Hi i have a situation like i want to download css files from different server whose css will have scoped attached to it, something like shown below.

[Downloaded css with scope id data-v-98b365f2] - component Dell

.Dell[data-v-98b365f2]{
    ........
}

Append to head, the above css file

now in my vue

import Dell from './Dell.vue';
export default{
    name:'Main-Component',
    component:{Dell}, <-- here i want to attach above scope-id of downloaded css file i,e data-v-98b365f2
}

Question: how to render a component with given scope id in my case data-v-98b365f2

Note: my downloaded file scope-id will never change, even if changes i will get it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文