gpt4 book ai didi

css - 视觉 : how to change the style of scoped child components

转载 作者:太空宇宙 更新时间:2023-11-04 06:07:46 24 4
gpt4 key购买 nike

我在vue中使用了vant ui组件,比如按钮,我想稍微改变一下它的样式,比如颜色,边框......,但我不知道如何完成它,任何人都可以帮助我解决问题?提前致谢!

我试过在元素上添加 css 或内联样式,但没有用!

最佳答案

可以使用深度选择器更改任何自定义组件的 CSS

GitHub 引用 - https://github.com/vuejs/vue-loader/issues/913

在这种情况下使用 ::v-deep,因为 /deep/ 将被弃用。

引用 - Deep Selector

只需检查要使用 chrome 或任何浏览器控制台中的 devtools 修改的呈现的 element 的类。

然后,在你消费组件时,修改它

<style scoped>
::v-deep vant-component-class {
background: red; //
}
</style>

关于css - 视觉 : how to change the style of scoped child components,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56697673/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com