1 Star 2 Fork 1

zarm-vue / zarm-vue-next

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Zarm Vue Next

版本

  • Alpha版:npm package

基于Vue3.0使用

  • 使用vue-cli初始化Vue3.x项目

Install 安装

npm install zarm-vue-next --save

Import 引入

  • 全组件引入
import { createApp } from 'vue';
import zarmVue from 'zarm-vue-next';
// 引入全局样式
import 'zarm-vue-next/zarm-vue.default.css';

const app = createApp(App);
app.use(zarmVue);
  • 按需引入

借助ElementUI提供的babel-plugin-component,我们可以只引入需要的组件,以达到减小项目体积的目的。

首先,安装 babel-plugin-component:

npm install babel-plugin-component -D

然后,将 .babelrc 添加:

{
  // ...
  "plugins": [["component", {
      "libraryName": "zarm-vue-next",
      "styleLibraryName": "theme"
    }
  ]]
}

接下来,如果你只希望引入部分组件,比如 Button 和 Alert,那么需要在 main.js 中写入以下内容:

import { Button, Alert } from 'zarm-vue-next'
app.use(Button)
app.use(Alert)
  • 也可以通过cdn引入umd模块
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://unpkg.com/zarm-vue-next@latest/zarm-vue.default.css">
  <script src="https://unpkg.com/vue@latest/dist/vue.min.js"></script>
  <script src="https://unpkg.com/zarm-vue-next@latest/zarm-vue.umd.js"></script>
</head>
<body>
  <div id="app">
      <za-button theme="primary">普通按钮</za-button>
  </div>
</body>
<script>
  Vue.createApp().mount("#app");
</script>
</html>

暗黑模式

  • import
// 引入暗黑样式
import 'zarm-vue-next/zarm-vue.dark.css';
  • umd
<link rel="stylesheet" href="https://unpkg.com/zarm-vue-next@latest/zarm-vue.dark.css">
MIT License Copyright (c) 2017 ZhonganTech Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/zarm-vue/zarm-vue-next.git
git@gitee.com:zarm-vue/zarm-vue-next.git
zarm-vue
zarm-vue-next
zarm-vue-next
main

搜索帮助