nieyuge 3 năm trước cách đây
mục cha
commit
a4fefdaa0a

+ 8 - 16
README.md

@@ -1,24 +1,16 @@
-# lv-ui
+# lv-ui
 
-## Project setup
+## 编译文档
 ```
-npm install
+npm run build:docs
 ```
 
-### Compiles and hot-reloads for development
+### 编译插件库
 ```
-npm run serve
+npm run build:component
 ```
 
-### Compiles and minifies for production
+### 本地查看文档
 ```
-npm run build
-```
-
-### Lints and fixes files
-```
-npm run lint
-```
-
-### Customize configuration
-See [Configuration Reference](https://cli.vuejs.org/config/).
+npm run dev:docs
+```

+ 10 - 0
docs/.vuepress/config.js

@@ -0,0 +1,10 @@
+module.exports = {
+    title: '票圈UI交互库',
+    themeConfig: {
+        sidebar: [
+            ['/', '首页'],
+            'guide/',
+            'components/',
+        ]
+    }
+}

+ 15 - 0
docs/README.md

@@ -0,0 +1,15 @@
+---
+home: true
+heroText: 票圈前端组件库
+tagline: 为开发节约时间、为设计提供规范的组件库
+actionText: 快速上手 →
+actionLink: /guide/
+features:
+- title: 简洁至上
+  details: 以 Markdown 为中心的项目结构,以最少的配置帮助你专注于写作。
+- title: Vue驱动
+  details: 享受 Vue + webpack 的开发体验,在 Markdown 中使用 Vue 组件,同时可以使用 Vue 来开发自定义主题。
+- title: 高性能
+  details: VuePress 为每个页面预渲染生成静态的 HTML,同时在页面被加载的时候,将作为 SPA 运行。
+footer: www.piaoquantv.com
+---

+ 32 - 0
docs/components/README.md

@@ -0,0 +1,32 @@
+# 组件
+
+## 按钮
+
+### 基础用法
+
+```vue
+<lv-row>
+    <lv-button></lv-button>
+    <lv-button type="primary">主要按钮</lv-button>
+    <lv-button type="success">成功按钮</lv-button>
+    <lv-button type="info">信息按钮</lv-button>
+    <lv-button type="warning">警告按钮</lv-button>
+    <lv-button type="danger">危险按钮</lv-button>
+</lv-row>
+```
+
+## 弹出授权框
+
+```vue
+<lv-authorize
+    sendUrl=""
+    checkUrl=""
+    @success="">
+</lv-authorize>
+```
+
+|  参数   | 说明  |  类型  |  可选值  |  默认值 |
+|  ----  | ----  | ----  | ------  | -----  |
+| sendUrl  | 发送验证码接口 |
+| checkUrl  | 校验验证码接口 |
+

+ 11 - 0
docs/guide/README.md

@@ -0,0 +1,11 @@
+# 指南
+
+## 安装
+
+
+```javascript
+// npm源切换至 http://192.168.203.180:4873/
+npm install --save lv-ui
+```
+
+## 快速上手

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 852 - 0
package-lock.json


+ 6 - 2
package.json

@@ -3,8 +3,11 @@
   "version": "0.1.0",
   "private": true,
   "scripts": {
-    "serve": "vue-cli-service serve",
+    "dev": "vue-cli-service serve",
+    "dev:docs": "vuepress dev docs",
     "build": "vue-cli-service build",
+    "build:docs": "vuepress build docs",
+    "build:component": "vue-cli-service build --target lib --name lv ./src/components/index.js",
     "lint": "vue-cli-service lint"
   },
   "dependencies": {
@@ -20,7 +23,8 @@
     "eslint-plugin-vue": "^6.2.2",
     "less": "^3.0.4",
     "less-loader": "^5.0.0",
-    "vue-template-compiler": "^2.6.11"
+    "vue-template-compiler": "^2.6.11",
+    "vuepress": "^1.8.2"
   },
   "eslintConfig": {
     "root": true,

+ 27 - 5
src/App.vue

@@ -1,17 +1,39 @@
 <template>
   <div id="app">
-    <img alt="Vue logo" src="./assets/logo.png">
-    <HelloWorld msg="Welcome to Your Vue.js App"/>
+    <lv-row>
+      <lv-button @click="aaa">默认</lv-button>
+      <lv-button type="primary">主要</lv-button>
+      <lv-button type="success">成功</lv-button>
+      <lv-button type="info">信息</lv-button>
+      <lv-button type="warning">警告</lv-button>
+      <lv-button type="danger">危险</lv-button>
+    </lv-row>
+    <lv-row>
+      <lv-button round>默认</lv-button>
+      <lv-button round type="primary">主要</lv-button>
+      <lv-button round type="success">成功</lv-button>
+      <lv-button round type="info">信息</lv-button>
+      <lv-button round type="warning">警告</lv-button>
+      <lv-button round type="danger">危险</lv-button>
+    </lv-row>
+    <lv-row>
+      <lv-button round hand>默认</lv-button>
+    </lv-row>
   </div>
 </template>
 
 <script>
-import HelloWorld from './components/HelloWorld.vue'
-
 export default {
   name: 'App',
+  data() {
+    return {}
+  },
   components: {
-    HelloWorld
+  },
+  methods: {
+    aaa() {
+      alert(1)
+    }
   }
 }
 </script>

+ 12 - 0
src/assets/less/color.less

@@ -0,0 +1,12 @@
+@white: white;
+@black: black;
+@mainColor: #20214F;
+@secondColor: #1890FF;
+@fontColor: #333;
+@border: #dcdfe6;
+
+@primary: #409eff;
+@success: #67c23a;
+@info: #909399;
+@warning: #e6a23c;
+@danger: #f56c6c;

BIN
src/assets/logo.png


+ 0 - 58
src/components/HelloWorld.vue

@@ -1,58 +0,0 @@
-<template>
-  <div class="hello">
-    <h1>{{ msg }}</h1>
-    <p>
-      For a guide and recipes on how to configure / customize this project,<br>
-      check out the
-      <a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
-    </p>
-    <h3>Installed CLI Plugins</h3>
-    <ul>
-      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
-      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
-    </ul>
-    <h3>Essential Links</h3>
-    <ul>
-      <li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
-      <li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
-      <li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
-      <li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
-      <li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
-    </ul>
-    <h3>Ecosystem</h3>
-    <ul>
-      <li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
-      <li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
-      <li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
-      <li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
-      <li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
-    </ul>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'HelloWorld',
-  props: {
-    msg: String
-  }
-}
-</script>
-
-<!-- Add "scoped" attribute to limit CSS to this component only -->
-<style scoped lang="less">
-h3 {
-  margin: 40px 0 0;
-}
-ul {
-  list-style-type: none;
-  padding: 0;
-}
-li {
-  display: inline-block;
-  margin: 0 10px;
-}
-a {
-  color: #42b983;
-}
-</style>

+ 30 - 0
src/components/index.js

@@ -0,0 +1,30 @@
+import button from './lib/lv-button';
+import dialog from './lib/lv-dialog';
+import row from './lib/lv-row';
+
+const components = [
+    button,
+    dialog,
+    row
+];
+
+// 导出全部
+const install = function (Vue) {
+    components.forEach(item => {
+        Vue.component(item.name, item);
+    })
+}
+export default install;
+
+// 导出局部
+components.forEach(item => {
+    item.install = function(Vue) {
+        Vue.component(item.name, item);
+    }
+})
+export {
+    button,
+    dialog,
+    row
+}
+

+ 81 - 0
src/components/lib/lv-button.vue

@@ -0,0 +1,81 @@
+<template>
+    <button class="lv-button" :class="['lv-type-' + type, round ? 'round' : '', hand ? 'hand' : '']" @click="clickHandle">
+        <slot></slot>
+    </button>
+</template>
+
+<script>
+export default {
+    name: 'lv-button',
+    props: {
+        type: {
+            type: String,
+            default: 'default'
+        },
+        round: {
+            type: Boolean,
+            default: false
+        },
+        hand: {
+            type: Boolean,
+            default: false
+        }
+    },
+    data () {
+        return {}
+    },
+    methods: {
+        clickHandle() {
+            this.$emit('click')
+        }
+    }
+}
+</script>
+
+<style lang="less" scope>
+@import url('../../assets/less/color');
+.lv {
+    &-button {
+        border: 0;
+        margin: 0;
+        color: @black;
+        font-size: var(--main_font_size, 14px);
+        user-select: none;
+        padding: 6px 20px;
+        border: solid 1px @border;
+        background-color: @white;
+        margin: 0 2px;
+        &.round {
+            border-radius: 20px;
+        }
+        &.hand {
+            cursor: pointer;
+        }
+    }
+    &-type-primary {
+        color: @white;
+        border: solid 1px @primary;
+        background-color: @primary;
+    }
+    &-type-success {
+        color: @white;
+        border: solid 1px @success;
+        background-color: @success;
+    }
+    &-type-info {
+        color: @white;
+        border: solid 1px @info;
+        background-color: @info;
+    }
+    &-type-warning {
+        color: @white;
+        border: solid 1px @warning;
+        background-color: @warning;
+    }
+    &-type-danger {
+        color: @white;
+        border: solid 1px @danger;
+        background-color: @danger;
+    }
+}
+</style>

+ 12 - 0
src/components/lib/lv-dialog.vue

@@ -0,0 +1,12 @@
+<template>
+    <div></div>
+</template>
+
+<script>
+export default {
+    name: 'lv-dialog',
+    data () {
+        return {}
+    }
+}
+</script>

+ 25 - 0
src/components/lib/lv-row.vue

@@ -0,0 +1,25 @@
+<template>
+    <div class="lv-row">
+        <div class="lv-margin">
+            <slot></slot>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'lv-row',
+    data () {
+        return {}
+    }
+}
+</script>
+
+<style lang="less" scoped>
+.lv-row {
+    overflow: hidden;
+    .lv-margin {
+        margin: 2px 0;
+    }
+}
+</style>

+ 2 - 0
src/main.js

@@ -1,7 +1,9 @@
 import Vue from 'vue'
 import App from './App.vue'
+import lvui from './components/index'
 
 Vue.config.productionTip = false
+Vue.use(lvui)
 
 new Vue({
   render: h => h(App),

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác