1.0.2 • Published 1 year ago

my-style-ui v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

install

npm install my-style-ui --save-dev

usage

在babel.config.js中

// babel.config.js
module.exports = {
  presets: ["@vue/cli-plugin-babel/preset"],
  plugins: [
    [
      'component',
      {
        libraryName: 'element-ui',
        styleLibraryName: 'theme-chalk'
      },
      'element-ui'
    ],
    [
      'component',
      {
        libraryName: 'my-style-ui',
        styleLibrary: {
          "name": "lib-style", // same with styleLibraryName
          "base": false  // if theme package has a base.css
        }
      },
      'test-lib'
    ],
  ]
};

在test.vue中使用组件库

<template>
<div>
  <navbar :text="msg"></navbar>
  <bottomcon :text="msg"></bottomcon >
  <el-button type="primary" class="dg-margin-t-20">element-button</el-button>
</div>
</template>
<script>
import Vue from "vue";
import { navbar,bottomcon } from "my-style-ui";
import { button } from "element-ui";
Vue.use(navbar)
Vue.use(bottomcon)
Vue.use(button)
export default {
  data:function() {
      return {
          msg: 'text'
      }
  }
};
</script>
<style lang="scss">
.dg-margin-t-20{
    margin-top:20px;
}
</style>

1670926120024