• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

144
Vistas
ant design customize theme vue

i got my vue3 application setup so far with tailwind, and ant design but can't customize ant design theme i am following this guide

i got this error

 error  in ./node_modules/ant-design-vue/es/button/style/index.less

Syntax Error: TypeError: this.getOptions is not a function


 @ ./node_modules/ant-design-vue/es/button/style/index.less 4:14-207 15:3-20:5 16:22-215
 @ ./node_modules/ant-design-vue/es/button/style/index.js
 @ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/views/About.vue?vue&type=script&lang=js
 @ ./src/views/About.vue?vue&type=script&lang=js
 @ ./src/views/About.vue
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.8.57:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

i have this in vue.config.js

css: {
    loaderOptions: {
      less: {
        lessOptions: {
          modifyVars: {
            'primary-color': '#1DA57A',
            'link-color': '#1DA57A',
            'border-radius-base': '2px',
          },
          javascriptEnabled: true,
        },
      },
    },
  },

i've also installed less and less loader.

"less": "^4.1.2",
"less-loader": "^10.2.0",

and here is my babel.config.js

module.exports = {
  presets: ['@vue/cli-plugin-babel/preset'],
  plugins: [['import', { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: true }]],
};

am i doing anything wrong here

almost 3 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have to import the file antd.less as follows in main.js:

enter image description here

And your vue.config.js:

module.exports = {
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          modifyVars: {
            'primary-color': '#f6b26b',
            'link-color': '#f6b26b',
            'border-radius-base': '10px',
          },
          javascriptEnabled: true,
        },
      },
    },
  },
};
almost 3 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda