1 Star 0 Fork 0

奕初 / yunxiu-next

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

Yunxiu-next 指南

Hi! 首先感谢你使用 Yunxiu-next。

Yunxiu-next 是一套基于 Vue 3.x 开发的开源组件库,旨在快速搭建页面。

文档

您可以在上找到更多详细信息、API 和其他文档https://yichuspace.github.io/yunxiu-next

国内加速镜像站点

安装

推荐使用 npmyarn 进行安装,它能更好地和 webpack 打包工具配合使用。而且可以更好的和 es6 typescript 配合使用。并且支持按需引入

npm i yunxiu-next -S
# or
yarn add yunxiu-next

快速上手

引入

你可以引入整个 yunxiu-next,或是根据需要仅引入部分组件。我们先介绍如何引入完整的 yunxiu-next。

完整引入

在 main.js 中写入以下内容:

import { createApp } from 'vue'
import YunxiuNext from 'yunxiu-next'
import App from './App.vue'
import 'yunxiu-next/lib/styles/index.css'

const app = createApp(App)
app.use(YunxiuNext)
// app.use(YunxiuNext,{disabledDoc:true}) // 可以设置禁用doc地址log
app.mount('#app')

以上代码便完成了 yunxiu-next 的引入。需要注意的是,样式文件需要单独引入。

按需引入

借助插件 babel-plugin-import我们可以只引入需要的组件,以达到减小项目体积的目的

npm install babel-plugin-import --save-dev

然后,将 .babelrc 或 babel.config.js 修改为:

module.exports = {
  presets: [
    [
      '@vue/app',
      {
        useBuiltIns: 'entry',
      },
    ],
  ],
  plugins: [
    [
      'import',
      {
        libraryName: 'yunxiu-next',
        libraryDirectory: 'src/components',
      },
    ],
  ],
}

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

import { createApp } from 'vue'
import { YunButton } from 'yunxiu-next'
import App from './App.vue'
import 'yunxiu-next/lib/styles/components/button.css'

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

特别提醒:按需引用仍然需要导入样式,即在 main.js 或根组件 import 'yunxiu-next/lib/styles/index.css';

完整组件列表参考源代码

MIT License Copyright (c) 2021 奕初 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.

简介

暂无描述 展开 收起
JavaScript 等 4 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/yichu-gitee/yunxiu-next.git
git@gitee.com:yichu-gitee/yunxiu-next.git
yichu-gitee
yunxiu-next
yunxiu-next
main

搜索帮助

53164aa7 5694891 3bd8fe86 5694891