0.3.0 • Published 4 years ago

zyh-ui v0.3.0

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

demo:

Install

npm install zyh-ui --save

Usage

Global Use

Import in your entry script file and register it

import ZyhUI from 'zyh-ui'
import "/lib/styles/zyh-ui.css"

Vue.use(ZyhUI)

Example

<l-button>click</l-button>

On-demand Loading

Firstly, you should install babel-plugin-component in your project.

npm install babel-plugin-component

Configure your .babelrc file like this

{
  "plugins": [
    [
      "component",
      {
        "libraryName": "zyh-ui",
        "libDir": "lib",
        "styleLibrary": {
          "name": "styles",
          "base": false,
          "path": "[module].css"
        }
      }
    ]
  ]
}

The you can import component on demand, and you don't need to care about importing styles, the babel plugin will do it automaticly.

import Vue from 'vue'
import {Button} from 'zyh-ui'

Vue.component('a-button', Button)