Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sk-element-webpack

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sk-element-webpack

[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

  • 0.0.1-alpha.20
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vue-components-webpack4

Commitizen friendly

UI component library template based on webpack4 + babel7 + vue implementation

Install

Using npm:

# Requried axios lib
# npm i axios --save
npm install sk-element-webpack --save

Using a script tag for global use:

<!-- import CSS -->
<link rel="stylesheet" href="//xxx.xxx.com/dist/theme-default/index.css">
<!-- import JavaScript -->
<script type="text/javascript" src="//xxx.xxx.com/dist/sk-element.min.js"></script>

Usage

Fully import

In main.js:

import Vue from "vue";
import SKElement from "sk-element-webpack";
import App from "./App.vue";

Vue.use(SKElement);

new Vue({
  el: "#app",
  render: h => h(App)
});

On demand

With the help of babel-plugin-component, we can import components we actually need, making the project smaller than otherwise.

First, install babel-plugin-component:

npm install babel-plugin-component --save-dev

Then edit .babelrc/babel.config.js:

{
  "presets": [
    // other config
  ],
  "plugins": [
    [
      "component",
      {
        "libraryName": "sk-element-webpack",
        "libDir": "dist",
        "styleLibrary": {
          "name": "theme-default",
          "base": false
        }
      }
    ]
  ]
}

Next, if you need Text and other component, edit main.js:

import Vue from "vue";
import { Text } from "sk-element-webpack";
import App from "./App.vue";

Vue.component(Text.name, Text);
/* or
 * Vue.use(Text)
 */

new Vue({
  el: "#app",
  render: h => h(App)
});

Features

  • Support on-demand loading
  • I18n
  • Add CLI to support rapid development
  • Example docs with vuepress
  • Unit Test
  • CSS dynamic separation

FAQs

Package last updated on 04 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc