【问题标题】:Custom global components not applying style in NuxtJs自定义全局组件未在 NuxtJs 中应用样式
【发布时间】:2022-01-16 22:48:36
【问题描述】:

我已经构建了一些组件,例如按钮,并且我想在我的网站的几乎所有地方使用和重用。

我已经创建了插件

Object.entries(components).forEach((([name, component]) => {
  Vue.component(name, component)
}))

并在 nuxt.config 中注册

plugins [
  '@/plugins/components'
]
<style lang="scss">
  .btn__container {
    border-radius: '5px';
    border: '1px solid red';
    background-color: 'red';
  }
</style>

但是当我调用组件时它不应用样式

<v-button>button</v-button>

我正在尝试检查我的自定义按钮元素,但它被删除了,我不知道为什么

【问题讨论】:

    标签: css sass nuxt.js


    【解决方案1】:

    border-radius: '5px'; 不是有效的 CSS
    试试border-radius: 5px;

    【讨论】:

      猜你喜欢
      • 2019-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-22
      • 1970-01-01
      • 2021-02-08
      • 1970-01-01
      相关资源
      最近更新 更多