Skip to content

Instantly share code, notes, and snippets.

@sanrandry
Last active October 5, 2020 07:33
Show Gist options
  • Select an option

  • Save sanrandry/b9b2e8b339e03f5c99f0980d8c800b08 to your computer and use it in GitHub Desktop.

Select an option

Save sanrandry/b9b2e8b339e03f5c99f0980d8c800b08 to your computer and use it in GitHub Desktop.
vue uikit plugin

this is how we import a uikit with vue cli or nuxt js

form nuxt js

import the css in the css section on nuxt.config.js

 // Global CSS (https://go.nuxtjs.dev/config-css)
  css: ["@/assets/css/uikit.min.css"],

create a new plugin in the plugin directory and add this lines of code

import Vue from "vue";

import UIkit from "uikit";
import Icons from "uikit/dist/js/uikit-icons";

UIkit.use(Icons);

Vue.prototype.$uikit = UIkit;

use this plugin

// in nuxt.config.js
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
  plugins: [
    {
      src: "@/plugins/uikit",
      ssr: false
    }
  ],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment