GithubHelp home page GithubHelp logo

mzl-ui's Introduction

mzl-ui组件库

一套适合开发者使用的轻量级UI组件库,完美支持vue3


官网主页: mzl-ui使用文档


快速使用

npm install  mzl-ui --save
cnpm install  mzl-ui --save

引入

import { createApp } from 'vue'
import App from '@/App.vue'
import mzlUi from 'mzl-ui'
import '../node_modules/mzl-ui/dist/style.css'

const app = createApp(App)
app.use(mzlUi)
app.mount('#app')

按需引用

import { mButton, mInput } from 'mzl-ui'

愉快开始

<m-button>默认按钮</m-buttonn> 
<m-button type="primary">主要按钮</m-button>

Mzl UI 贡献指南

首先非常感谢您能选择使用 mzl-ui。mzl-ui 是基于 vue3.2 开发,mzl-ui 旨在秉承数据驱动视图,力求更小的体积、更快的相应、更强的拓展性、更完美的支持、更友好的渲染。任何一个开源库都离不开大家的共同贡献和维护,如果您愿意参与贡献,请阅读以下内容。

问题反馈

  • 如果您在使用中存在 bug 或者有更超前的**及解决方案,不限于新的组件、新的模式、新的**、新的方案,您可以在 Issue 提交问题,我们会定时进行维护并回复。
  • 或您可发送邮件至 [email protected] 来反馈或参与贡献。

分支规范

  • 贡献代码请保持在 dev 分支,禁止操作 main 分支。
  • 组件文档暂时需要提供 md 文件,包括(使用方式、演示、配置项、事件 API、插槽说明...)。
  • 提交代码前请先 rebase
  • git提交流程示例:
git add .
git commit -m"add component:button"   //示例
git pull --rebase origin dev
git push origin dev

文档集成规范

  • 组件目录下新增 doc 文件夹用于文档编写。
  • doc 文件夹下提供 doc.md,一个组件最多只允许一个 .md 文件。
  • doc 文件同级存放 demo.vue 文件,demo 不限个数。
  • 然后在 doc.md 文件顶部使用 setup 语法糖的方式引入 demo 文件,使用组件的形式展示。
  • src/router/routerPage/page.js 引入 md 文件作为路由使用即可。
  • 菜单管理文件在 /src/const/menuList.js, path 路劲二级路由名保持跟组件文件夹名及路由 path 配置一致。
  • Attributes.vue 作为参数组件,具体使用示例请参考 buttom/doc/Attributes.vue
  • Events.vue 作为事件API组件,具体使用示例请参考 input/doc/Events.vue
  • 如果有其他的api需要展示,新增相关组件文件并引入,例如:options.vue,具体使用示例请参考 tree/doc/options.vue
  • 代码预览文件为 src/components/Preview.vue,同时在 doc.md 文件以组件的形式引入 Preview.vue ,接收两个propscompName 为组件目录名(建议与路由名保持一致),demoName 为要展示的 demo 文件名,例如:
//doc.md
<script setup>
  import demo1 from './demo1.vue'; 
  import demo2 from './demo2.vue'; 
  import preview from '@/components/preview.vue'
  <div class="componetnsBox">
    <demo1/>
  </div>
  <preview compName="button" demoName="demo1"/>
  <div class="componetnsBox">
    <demo2/>
  </div>
  <preview compName="button" demoName="demo2"/>
</script>

组件测试规范

  • 任何一个组件应完成测试后提交 PR
  • 组件测试脚本存放目录为 tests 目录,提供 .spec.js 为后拽的测试脚本文件
  • 测试脚本需包含初始化测试、渲染测试、插槽测试、事件测试、功能测试等基础测试
  • 具体示例请参考 /tests/button.spec.js 脚本文件
  • 组件测试命令为:
yarn test || npm test

Issue 规范

  • 在提交 issue 之前,请搜索相关内容是否已被提出。
  • 请说明 mzl-uiVue 的版本号,并提供操作系统和浏览器信息。推荐使用 JSFiddle 生成在线 demo,这能够更直观地重现问题。

Pull Request 规范

  • 请先 fork 一份到自己的项目下,不要直接在仓库下建分支。
  • commit 信息要以[组件名]: 描述信息 的形式填写,例如 Button: fix xxx bug。
  • 执行 build 后可以正确打包文件。
  • 提交 PR 前请 rebase,确保 commit 记录的整洁。
  • 确保 PR 是提交到 dev 分支,而不是 main 分支。
  • 如果是修复 bug,请在 PR 中给出描述信息。
  • 合并代码会有专人审核,避免滥用植入等,审核通过后即可合并。
  • 打包测试组件命令为 yarn buildnpm run build
  • 打包网页文件包命令为 yarn build:htmlnpm run build:html

开发环境

  • 你需要 Node.js 14+,yarn 1.1+ 和 npm 6+及 vite 2+
  • 如果您在使用yarn安装依赖的过程中出现esline检查不通过,请执行:
yarn config set ignore-engines true

项目启动

npm run dev

项目打包

npm run build

组件开发规范

  • 通过在 packages 目录下创建组件目录结构,包含测试代码、入口文件、文档。
  • 组件入口文件必须以 index.js 命名,并包含 install 方法,参考代码:
import mButton from "./index.vue";
mButton.install = (app) => {
  app.component(mButton.name, mButton);
};
export default mButton;
  • packages 文件夹下 index.js 作为整体入口文件,须包含所有组件,若需要绑定全局变量或提供组件实例调用,参考代码:

    app.config.globalProperties.$message = Message;
    
  • 任何组件禁止使用三方依赖库。

  • 组件内如果依赖了其他组件,需要在当前组件内引入,参考 select

代码规范


mzl-ui's People

Contributors

evilhunter01 avatar hj-rookie avatar iamdin avatar ningstyle avatar potato-x avatar spark154204 avatar wally94 avatar zgx1996 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mzl-ui's Issues

eslint

是不是少了eslint的配置

打包网页后 代码不能显示

[plugin:rollup-plugin-dynamic-import-variables] invalid import "import(
/* @vite-ignore */ /packages/${props.compName}/doc/${props.demoName}.vue?raw
)". Variable absolute imports are not supported, imports must start with ./ in the static part of the import. For example: import(./foo/${bar}.js).

if (isDev) {
    sourceCode.value = (
      await import(
        /* @vite-ignore */ `/packages/${props.compName}/doc/${props.demoName}.vue?raw`
      )
    ).default;
  } else {
    sourceCode.value = await fetch(
      `/packages/${props.compName}/doc/${props.demoName}.vue`
    ).then((res) => res.text());
  }

打包网页应该进入到 else 里呀

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.