Commit 13004bb4 by luyt

components文件调整,新增文档,本地演示

1 parent 2cedecaf
......@@ -8,6 +8,7 @@ module-basic-data/node_modules/
module-report/node_modules/
node_modules/
LICENSE
website/
# Executables
*.swf
......
{
"include": [
"./src/packages/**/*.vue"
],
"title": "组件文档",
"genType": "docute"
}
\ No newline at end of file
'use strict';
const gulp = require('gulp')
const { series, src, dest } = require('gulp');
const sass = require('gulp-sass');
const cssmin = require('gulp-cssmin');
const rename = require('gulp-rename')
const concat = require('gulp-concat')
function compileCss() {
return src('./src/packages/**/*.scss')
.pipe(sass.sync())
.pipe(cssmin())
.pipe(dest('./dist/css'));
}
function compileAll() {
return src('./src/packages/**/*.scss')
.pipe(sass.sync())
.pipe(concat('index.css'))
.pipe(cssmin())
.pipe(dest('./dist/css'));
}
gulp.task('css',compileCss)
gulp.task('all',compileAll)
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>组件说明文档</title>
<link rel="stylesheet" href="https://unpkg.com/docute@4/dist/docute.css">
<link rel="stylesheet" href="./glsx-components.css">
</head>
<body>
<div id="docute">
首页
</div>
<script src="https://unpkg.com/docute@4/dist/docute.js"></script>
<script src="./glsx-components.umd.min.js"></script>
<script>
new Docute({
target: '#docute',
sidebar: [
{
title: '组件文档',
links: [
{
title: 'TestComp',
link: '/components/TestComp'
},
{
title: 'TestComp2',
link: '/components/Test'
}
]
}
]
})
</script>
</body>
</html>
\ No newline at end of file
// require("./build/gulp.css.js")
const { src, dest, series } = require('gulp')
const fs = require('fs')
const through2 = require('through2');
// 迭代 components 下的所有 md 文件,并合并到 website/components 下的同名文件
function generateMd(){
return src('./src/packages/**/*.md').pipe(through2.obj(function (file, _, cb) {
let filename = file.path.split(/\\/).pop()
console.log(filename)
if (file.isBuffer()) {
try{
fs.readFile(`./website/components/${filename}`, (err, data) => {
if (err) throw err;
let fileContent = file.contents.toString() + '\n\n' + data
fs.writeFile(`./website/components/${filename}`, fileContent , (err)=>{
if(err)return console.error(err)
console.log(`写入 ${filename} 成功`)
cb()
})
});
}catch(exception){
cb()
}
}
}))
}
function copyFile(){
return src(['./dist/*.js','./dist/*.css','./documents/index.html']).pipe(dest('./website/'))
}
// require("./build/gulp.css.js")
exports.default = series(generateMd,copyFile)
\ No newline at end of file
This diff could not be displayed because it is too large.
......@@ -9,17 +9,24 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lib": "vue-cli-service build --target lib --name glsx-components ./src/packages/index.js"
"lib": "vue-cli-service build --target lib --name glsx-components ./src/packages/index.js",
"document": "vuese gen && gulp && vuese serve --open"
},
"dependencies": {
"core-js": "^3.6.5",
"element-ui": "^2.15.6",
"glsx-common": "^1.3.2",
"gulp": "^4.0.2",
"vue": "^2.6.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"gulp-autoprefixer": "^8.0.0",
"gulp-concat": "^2.6.1",
"gulp-cssmin": "^0.2.0",
"gulp-rename": "^2.0.0",
"gulp-sass": "^5.0.0",
"node-sass": "^4.14.1",
"sass-loader": "^8.0.0",
"vue-template-compiler": "^2.6.11"
......
......@@ -12,7 +12,7 @@
<el-button size="small" @click="visible = false">取消</el-button>
<el-button type="primary" size="small">aaa</el-button>
</div>
</GLDialog>
</GLDialog> -->
<GLTable ref="liveRoomRef" :tableParams="tableParams" :tableData="tableData">
<span slot="shareImgUrl" slot-scope="scope">
<img class="img-60" :src="scope.scope.shareImgUrl" />
......@@ -23,8 +23,8 @@
<el-button v-if="scope.scope.liveStatus == '102'" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.liveStatus != '101'" type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</GLTable> -->
<el-table :data="tableData" style="width: 100%">
</GLTable>
<!-- <el-table :data="tableData" style="width: 100%">
<el-table-column prop="date" label="序号" align="center"></el-table-column>
<el-table-column label="订单信息" align="center">
<el-table-column prop="name" label="支付订单编号" align="center"></el-table-column>
......@@ -48,18 +48,14 @@
<el-table-column prop="name" align="center" label="分润金额"></el-table-column>
<el-table-column prop="name" align="center" label="分账类型"></el-table-column>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="120"></el-table-column>
</el-table>
<el-table-column fixed="right" label="操作" align="center" width="120">添加</el-table-column>
</el-table> -->
</div>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
export default {
name: 'App',
components: {
HelloWorld
},
data() {
return {
visible: false,
......@@ -101,11 +97,69 @@ export default {
width: '80',
formatter: cellValue => {
return 111
}
},
children:[
{
label: '直播状态1',
prop: 'liveStatus1',
line: 1,
addHtml: 'shareImgUrl',
children:[
{
label: '直播状态3',
prop: 'liveStatus3',
line: 1,
addHtml: 'shareImgUrl'
},
{
label: '直播状态4',
prop: 'liveStatus3',
line: 1,
addHtml: 'shareImgUrl'
},
]
},
{
label: '直播状态2',
prop: 'liveStatus2',
line: 1,
addHtml: 'shareImgUrl',
// children:[
// {
// label: '直播状态3',
// prop: 'liveStatus3',
// line: 1,
// addHtml: 'shareImgUrl'
// }
// ]
},
]
}
]
},
tableData: []
tableData: [
{
name: '王小虎王小虎王小虎王',
},
{
name: '王小虎王小虎王小虎王王小虎王小虎王小虎王',
},
{
name: '王小虎',
},
{
name: '王小虎王小虎王小虎王',
},
{
name: '王小虎王小虎王小虎王王小虎王小虎王小虎王',
},
{
name: '王小虎',
},
{
name: '王小虎王小虎王小虎王',
}
]
}
},
methods: {
......@@ -123,7 +177,7 @@ export default {
}
</script>
<style>
<style lang="scss">
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
......@@ -132,4 +186,10 @@ export default {
color: #2c3e50;
margin-top: 60px;
}
// table滚动调样式
// table滚动调样式
</style>
<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>
</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>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
/**
* 用本地打包后的组件 文件测试 umd
* 启动项目工程即可
*/
//创建的组件
import Vue from 'vue'
import {
GLExternal,
GLButton,
GLDialog,
GLTable} from '../../dist/glsx-components.umd.min.js'
import '../../dist/glsx-components.css'
const permissions = {
routes: [
{ path: '/', meta: { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] } },
{ path: '/a', meta: {} }
],
routerBase: ''
}
Vue.use(GLButton, permissions)
Vue.use(GLExternal)
Vue.use(GLDialog)
Vue.use(GLTable)
\ No newline at end of file
import Vue from 'vue'
import App from './App.vue'
import { GLExternal, GLButton, GLDialog, GLTable, Table, TableColumn } from './packages/index'
import '../dist/glsx-components.css'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(GLExternal)
Vue.use(GLDialog)
Vue.use(GLTable)
Vue.use(Table)
Vue.use(TableColumn)
const permissions = {
routes: [
{ path: '/', meta: { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] } },
{ path: '/a', meta: {} }
],
routerBase: ''
}
Vue.use(GLButton, permissions)
Vue.config.productionTip = false
new Vue({
render: h => h(App)
}).$mount('#app')
// import Vue from 'vue'
// import App from './App.vue'
// import { GLExternal, GLButton, GLDialog, GLTable, Table, TableColumn,Popover } from './packages/index'
// import 'element-ui/lib/theme-chalk/index.css'
// import '../dist/glsx-components.css'
// Vue.use(GLExternal)
// Vue.use(GLDialog)
// Vue.use(GLTable)
// Vue.use(Table)
// Vue.use(TableColumn)
// Vue.use(Popover)
// const permissions = {
// routes: [
// { path: '/', meta: { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] } },
// { path: '/a', meta: {} }
// ],
// routerBase: ''
// }
// Vue.use(GLButton, permissions)
// Vue.config.productionTip = false
// new Vue({
// render: h => h(App)
// }).$mount('#app')
/***
* new line
*/
import Vue from 'vue'
import App from './App.vue'
//第二次封装的组件
import './localtest/index'
Vue.config.productionTip = false
new Vue({
render: h => h(App)
}).$mount('#app')
\ No newline at end of file
......@@ -79,15 +79,15 @@ export default {
padding: 20px 20px;
}
&::-webkit-scrollbar {
width: 10px;
height: 10px;
width: 8px;
height: 8px;
}
/*正常情况下滑块的样式*/
&::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 10px;
border-radius: 8px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在该类指向的控件上时滑块的样式*/
......@@ -96,7 +96,7 @@ export default {
// background-color: rgba(0, 0, 0, 0.2);
background: #e9e8ff;
border-radius: 10px;
border-radius: 8px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
......@@ -112,7 +112,7 @@ export default {
/*正常时候的主干部分*/
&::-webkit-scrollbar-track {
border-radius: 10px;
border-radius: 8px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
......
<template>
<div class="glsx-table">
<el-table id="initTable" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-class-name="tableParams.rowClassName" :row-style="tableParams.rowStyle" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" :highlight-current-row="true" :stripe="true" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle" :show-summary="tableParams.showSummary" :summary-method="tableParams.summaryMethod">
<el-table id="initTable" v-bind="$attrs" v-on="$listeners" :key="componentKey" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-class-name="tableParams.rowClassName" :row-style="tableParams.rowStyle" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle" :show-summary="tableParams.showSummary" :summary-method="tableParams.summaryMethod">
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column>
<el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column>
<el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'center'" :sortable="item.sortable" :render-header="item.renderHeader">
......@@ -12,13 +12,28 @@
<template v-else-if="getListApi">
<span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" :title="scope.row[item.prop]" v-text="scope.row[item.prop]"></span>
</template>
<!-- <template v-else-if="item.labelchildren">
<el-table-column v-for="(labelitem, labelindex) in tableColumns.labelchildren" :key="'labelindex'+labelindex">
<span>123456</span>
</el-table-column> -->
<!-- <span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" :title="tableData[scope.$index][item.prop]" v-text="tableData[scope.$index][item.prop]"></span> -->
<!-- </template> -->
<template v-else>
<span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" :title="tableData[scope.$index][item.prop]" v-text="tableData[scope.$index][item.prop]"></span>
<!-- 大于10或 20个字节长度 -->
<el-popover v-if="tableData[scope.$index][item.prop] && tableData[scope.$index][item.prop].length >= 10 * item.line" placement="top" title="标题" width="200" trigger="click" :content="tableData[scope.$index][item.prop]">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span>
</el-popover>
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span>
</template>
<template v-if="item.addSymbol">
<span v-text="item.addSymbol"></span>
</template>
</template>
<!-- 递归 -->
<sub-el-table-column v-if="item.children" :data="item.children"></sub-el-table-column>
</el-table-column>
<el-table-column v-if="tableParams.tableOption" label="操作" :align="tableParams.tableOption.align || 'center'" :width="tableParams.tableOption.width || '200'" fixed="right">
<template slot-scope="scope">
......@@ -36,11 +51,13 @@
</template>
<script>
import { Table, TableColumn, Pagination } from 'element-ui'
import SubElTableColumn from './sub-el-table-column.vue'
// import { Table, TableColumn, Pagination } from 'element-ui'
import { Table } from 'element-ui'
// 解决 ElTable 自动宽度高度导致的「ResizeObserver loop limit exceeded」问题
const fixElTableErr = table => {
const oldResizeListener = table.methods.resizeListener
table.methods.resizeListener = function() {
table.methods.resizeListener = function () {
window.requestAnimationFrame(oldResizeListener.bind(this))
}
}
......@@ -50,8 +67,9 @@ export default {
components: {
[Table.name]: Table,
[TableColumn.name]: TableColumn,
[Pagination.name]: Pagination
// [TableColumn.name]: TableColumn,
// [Pagination.name]: Pagination,
SubElTableColumn
},
props: {
......@@ -205,7 +223,9 @@ export default {
tableColumns: [],
showClass: false,
tableHeightValues: null
tableHeightValues: null,
bAntiShike:false, //防抖
componentKey:Date.now(), //用于更新组件
}
},
......@@ -335,6 +355,21 @@ export default {
this.page[this.pageConf.pageSize] = 10
this.page[this.pageConf.pageNum] = 1
this.getListApi && this.refreshTable()
// 注册事件 -- 防抖
window.onresize = () => {
if (!this.bAntiShike) {
this.bAntiShike = true
setTimeout(() => {
// console.log('组件跟新时间')
this.bAntiShike = false
this.componentKey = Date.now()
}, 300)
}
}
},
beforeDestroy () {
// 事件注销
window.onresize = null
}
}
</script>
......@@ -369,8 +404,8 @@ export default {
height: 100%;
}
.el-table__body-wrapper::-webkit-scrollbar {
width: 10px;
height: 10px;
width: 8px;
height: 8px;
/* display: none; */
}
......@@ -378,7 +413,7 @@ export default {
.el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 10px;
border-radius: 8px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在该类指向的控件上时滑块的样式*/
......@@ -387,7 +422,7 @@ export default {
/* background-color: rgba(0, 0, 0, 0.2); */
background: #e9e8ff;
border-radius: 10px;
border-radius: 8px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
......@@ -403,7 +438,7 @@ export default {
/*正常时候的主干部分*/
.el-table__body-wrapper::-webkit-scrollbar-track {
border-radius: 10px;
border-radius: 8px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
......@@ -423,4 +458,26 @@ export default {
/* .hasTableContent .el-table__body-wrapper{
height: 100%;
} */
/* 样式新增光亮tr */
/* .el-table */
.el-table .el-table__body tr.hover-row {
position: relative;
/* z-index: 100; */
box-shadow: 0px 3px 10px 0px rgba(60, 58, 96, 0.3), 0px 1px 0px 0px rgba(255, 255, 255, 0.85);
}
.el-table .el-table__body tr.hover-row > td.el-table__cell {
background-color: #f4f4fc;
}
.el-table .el-table__body tr.hover-row::after {
position: absolute;
top: 0;
left: 0;
display: inline-block;
content: '';
width: 5px;
height: 100%;
background-color: #5850ff;
}
/* 样式新增光亮tr */
</style>
<template>
<div class="sub-el-table-column">
<el-table-column v-for="(item, index) in reverseData" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'center'" :sortable="item.sortable" :render-header="item.renderHeader">
<template slot-scope="scope">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
<template v-else-if="item.formatter">
<span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" :title="item.formatter(scope.row)" v-text="item.formatter(scope.row)"></span>
</template>
<template v-else-if="getListApi">
<span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" :title="scope.row[item.prop]" v-text="scope.row[item.prop]"></span>
</template>
<!-- <template v-else-if="item.labelchildren">
<el-table-column v-for="(labelitem, labelindex) in tableColumns.labelchildren" :key="'labelindex'+labelindex">
<span>123456</span>
</el-table-column> -->
<!-- <span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" :title="tableData[scope.$index][item.prop]" v-text="tableData[scope.$index][item.prop]"></span> -->
<!-- </template> -->
<template v-else>
<!-- 大于10或 20个字节长度 -->
<el-popover v-if="tableData[scope.$index][item.prop] && tableData[scope.$index][item.prop].length >= 10 * item.line" placement="top" title="标题" width="200" trigger="click" :content="tableData[scope.$index][item.prop]">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span>
</el-popover>
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span>
</template>
<template v-if="item.addSymbol">
<span v-text="item.addSymbol"></span>
</template>
</template>
<!-- 递归 -->
<sub-el-table-column v-if="item.children" :data="item.children"></sub-el-table-column>
</el-table-column>
</div>
</template>
<script>
export default {
name: 'sub-el-table-column',
props: {
data: {
type: Array,
default: () => []
}
},
computed: {
reverseData() {
return [...this.data].reverse()
}
}
// created(){
// // console.log('data',this.data)
// }
}
</script>
<style lang="scss">
.sub-el-table-column {
}
</style>
\ No newline at end of file
import TestComp from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
TestComp.install = function(Vue) {
Vue.component(TestComp.name, TestComp)
}
// 默认导出组件
export default TestComp
<test-comp @click='btnClick'>常规按钮</test-comp>
<test-comp @click='btnClick' type='success'>成功按钮</test-comp>
```js {mixin:true}
{
data() {
return {
}
},
methods:{
btnClick(){
alert('点击')
}
}
}
```
# 用来作为 markdown 代码的示例部分
```html
<template>
<test-comp @click='btnClick'>常规按钮</test-comp>
<test-comp @click='btnClick' type='success'>成功按钮</test-comp>
</template>
<script>
export default {
data() {
return {
}
},
methods:{
btnClick(){
alert('点击')
}
}
}
</script>
```
<template>
<div class="testcomp">
<el-button @click="btnClick" v-bind="$attrs" v-on="$listeners">
<!-- 插槽 -->
<slot></slot>
</el-button>
</div>
</template>
<script>
export default {
name:'TestComp',
props:{
// 类型的种类 `medium` / `small` / `mini`
demosize:{
type:String,
default:'medium'
},
// `primary` / `success`
demotype:{
type:String,
default:'primary'
}
},
data(){
return{
}
},
methods:{
btnClick(){
// 这是点击事件
this.$emit('点击')
}
}
}
</script>
<style lang="scss">
.testcomp{
display:inline-block;
}
</style>
\ No newline at end of file
// // 导入颜色选择器组件
// import GLExternal from './External'
// import GLButton from './Button'
// import GLDialog from './Dialog'
// import GLTable from './Table'
// import '@/plugins/element.js'
// import '@/theme/theme.scss'
// import { Table, TableColumn, Popover } from 'element-ui'
// // 存储组件列表
// const components = [GLExternal, GLButton, GLDialog, GLTable, Table, TableColumn, Popover]
// // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
// const install = function(Vue) {
// // 判断是否安装
// if (install.installed) return
// // 遍历注册全局组件
// components.map(component => Vue.component(component.name, component))
// }
// // 判断是否是直接引入文件
// if (typeof window !== 'undefined' && window.Vue) {
// install(window.Vue)
// }
// export { GLExternal, GLButton, GLDialog, GLTable, Table, TableColumn ,Popover}
// export default {
// // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
// install
// }
/***
* new line
*/
// 导入颜色选择器组件
import '@/plugins/element.js'
import '@/theme/theme.scss'
import GLExternal from './External'
import GLButton from './Button'
import GLDialog from './Dialog'
import GLTable from './Table'
import '@/theme/theme.scss'
import '@/plugins/element.js'
import { Table, TableColumn } from 'element-ui'
// test 组件
import TestComp from './TestComp'
// 存储组件列表
const components = [GLExternal, GLButton, GLDialog, GLTable, Table, TableColumn]
const components = [GLExternal, GLButton, GLDialog, GLTable,TestComp]
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
const install = function(Vue) {
// 判断是否安装
if (install.installed) return
......@@ -19,8 +55,13 @@ const install = function(Vue) {
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue)
}
export { GLExternal, GLButton, GLDialog, GLTable, Table, TableColumn }
export default {
// 导出的对象必须具有 install,才能被 Vue.use() 方法安装
install
}
install,
GLExternal,
GLButton,
GLDialog,
GLTable,
TestComp
}
\ No newline at end of file
import Vue from 'vue'
// import Vue from 'vue'
// import 'element-ui/lib/theme-chalk/index.css'
import { Button, ButtonGroup, Loading, Input, Form, FormItem } from 'element-ui'
// import { Button, ButtonGroup, Loading, Input, Form, FormItem } from 'element-ui'
// Vue.use(Loading)
// Vue.use(Button)
// Vue.use(ButtonGroup)
// // Vue.use(Table)
// Vue.use(Input)
// Vue.use(Form)
// Vue.use(FormItem)
/**
* new line 2021-12-15
*
*/
import Vue from 'vue'
import { Table, TableColumn,Popover,Button, ButtonGroup, Loading, Input, Form, FormItem ,Pagination } from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css' //todo 按需引入插件样式
import 'element-ui/lib/theme-chalk/table.css'
import 'element-ui/lib/theme-chalk/table-column.css'
import 'element-ui/lib/theme-chalk/popover.css'
import 'element-ui/lib/theme-chalk/button.css'
import 'element-ui/lib/theme-chalk/button-group.css'
import 'element-ui/lib/theme-chalk/loading.css'
import 'element-ui/lib/theme-chalk/input.css'
import 'element-ui/lib/theme-chalk/form.css'
import 'element-ui/lib/theme-chalk/form-item.css'
import 'element-ui/lib/theme-chalk/pagination.css'
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Popover)
Vue.use(Loading)
Vue.use(Button)
Vue.use(ButtonGroup)
// Vue.use(Table)
Vue.use(Input)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Pagination)
\ No newline at end of file
/**
单组件文件样式调整
*/
$defaultColor: #5850FF;
$lightColor: #7973ff;
$dackColor: #4f48e6;
......
const path = require("path");
const resolve = (dir) => path.join(__dirname, dir);
module.exports = {
productionSourceMap: false,
chainWebpack: (config) => {
config.resolve.alias.set("@", resolve("src"));
},
......@@ -17,6 +18,7 @@ module.exports = {
library: "glsx-components",
libraryTarget: "umd",
umdNamedDefine: true,
libraryExport: 'default'
},
},
};
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!