Commit e159acde by luyt

add: 1.GLSearch,GLSearchItem组件 2.GLSearch,GLSearchItem文档添加

1 parent 87fbe974
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -35,7 +35,15 @@ ...@@ -35,7 +35,15 @@
{ {
title: 'Popover(el)-气泡框', title: 'Popover(el)-气泡框',
link: '/components/Popover' link: '/components/Popover'
} },
{
title: 'GLSearchItem',
link: '/components/GLSearchItem'
},
{
title: 'GLSearch',
link: '/components/GLSearch'
},
] ]
}] }]
......
...@@ -38,14 +38,19 @@ function generateMd() { ...@@ -38,14 +38,19 @@ function generateMd() {
function copyFile() { function copyFile() {
// return src(['./dist/*.js','./dist/*.css','./documents/index.html']).pipe(dest('./website/')) // return src(['./dist/*.js','./dist/*.css','./documents/index.html']).pipe(dest('./website/'))
return src(['./dist/*.js', './dist/*.css', './documents/**/*.*']).pipe(dest('./website/'))
return src(['./dist/*.js', './dist/*.css', './dist/fonts/*.*', './documents/**/*.*']).pipe(dest('./website/'))
}
function copyFonts() {
return src(['./dist/fonts/*.*']).pipe(dest('./website/fonts/'))
} }
// require("./build/gulp.css.js") // require("./build/gulp.css.js")
//监听这些文件的变换,不需要cb //监听这些文件的变换,不需要cb
function watcher() { function watcher() {
watch('src/**/*.*', generateMd, copyFile) watch('src/**/*.*', generateMd, copyFile, copyFonts)
watch('documents/**/*.*', generateMd, copyFile) watch('documents/**/*.*', generateMd, copyFile, copyFonts)
} }
exports.default = series([generateMd, copyFile, watcher]) exports.default = series([generateMd, copyFile, copyFonts, watcher])
...@@ -82,8 +82,30 @@ ...@@ -82,8 +82,30 @@
</el-popover> --> </el-popover> -->
<hr /> <hr />
<!-- 测试 GlTableSearch --> <!-- 测试 GlSearch -->
<GlTableSearch></GlTableSearch>
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
<hr /> <hr />
<!-- 测试 GLFooter --> <!-- 测试 GLFooter -->
...@@ -294,7 +316,56 @@ export default { ...@@ -294,7 +316,56 @@ export default {
// name: '王小虎', // name: '王小虎',
// address: '上海市普陀区金沙江路 1518 弄' // address: '上海市普陀区金沙江路 1518 弄'
// } // }
] ],
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
} }
}, },
methods: { methods: {
...@@ -307,6 +378,13 @@ export default { ...@@ -307,6 +378,13 @@ export default {
click() { click() {
console.log(111111111111) console.log(111111111111)
this.visible = true this.visible = true
},
//gl-search 方法
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
} }
} }
} }
...@@ -324,4 +402,4 @@ export default { ...@@ -324,4 +402,4 @@ export default {
height: 2000px; height: 2000px;
font-size: 14px; font-size: 14px;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
GLButton, GLButton,
GLDialog, GLDialog,
GLTable, GLTable,
GLFooter GLFooter,
GlSearch,
GlSearchItem
} from '../../dist/glsx-components.umd.min.js' } from '../../dist/glsx-components.umd.min.js'
import '../../dist/glsx-components.css' import '../../dist/glsx-components.css'
...@@ -25,4 +27,6 @@ ...@@ -25,4 +27,6 @@
Vue.use(GLExternal) Vue.use(GLExternal)
Vue.use(GLDialog) Vue.use(GLDialog)
Vue.use(GLTable) Vue.use(GLTable)
Vue.use(GLFooter)
\ No newline at end of file \ No newline at end of file
Vue.use(GLFooter)
Vue.use(GlSearch)
Vue.use(GlSearchItem)
\ No newline at end of file \ No newline at end of file
...@@ -51,10 +51,10 @@ Object.keys(filters).forEach(key => { ...@@ -51,10 +51,10 @@ Object.keys(filters).forEach(key => {
// // import '../dist/glsx-components.css' // // import '../dist/glsx-components.css'
// //开发完成后,本地测试使用我们第二次封装的组件 // //开发完成后,本地测试使用我们第二次封装的组件
import './index' // import './index'
//开发完成后,打包后本地测试,我们第二次封装的组件 //开发完成后,打包后本地测试,我们第二次封装的组件
// import './localtest/index' import './localtest/index'
Vue.config.productionTip = false Vue.config.productionTip = false
......
import GLSearch from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearch.install = function(Vue) {
Vue.component(GLSearch.name, GLSearch)
}
// 默认导出组件
export default GLSearch
\ No newline at end of file \ No newline at end of file
<!-- <content> -->
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
<el-button type="warning" @click="toggleShow(1)">显示代码</el-button>
```js {mixin:true}
{
data() {
return {
demo1: true,
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods:{
toggleShow(num){
// console.log(123)
this['demo' + num] = !this['demo' + num]
},
//gl-search 方法
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
```
# 用来作为 markdown 代码的示例部分
<div v-if="demo1">
```vue
<template>
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
</template>
<script>
import {GLSearch, GLSearchItem} from 'glsx-components'
// 全局引入一次css即可
import 'glsx-components/dist/glsx-components.css'
export default {
data() {
return {
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods: {
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
</script>
```
</div>
<!-- </content> -->
<template>
<div class="gl-search" id="gl-search" :class="{ transTo: !expand }">
<div class="search-list">
<!-- 默认插槽 -->
<slot></slot>
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div>
<div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
</div>
<div class="gl-operate">
<div class="operate">
<el-button size="small" type="primary" @click="handleOk"
>查询</el-button
>
<el-button size="small" @click="handleRest">重置</el-button>
<el-button type="text" size="small" @click="expandFn" v-if="hasExpand">
<span>{{ !expand ? "展开" : "收起" }}</span>
<i class="expand" :class="classIcon"></i>
</el-button>
<!-- <i class="el-icon-arrow-down expand"></i> -->
<!-- <i class="el-icon-arrow-up"></i> -->
</div>
</div>
</div>
</template>
<script>
export default {
name: 'GLSearch',
props: {},
data () {
return {
// input: '',
expand: false,
itemNum: 0,
time: null,
hasExpand: false
}
},
created () {},
mounted () {
this.getItemNum()
// 判断宽度按,是否显示展开收起
this.getClientWith()
window.addEventListener('resize', this.getClientWith, false)
},
computed: {
classIcon () {
return !this.expand ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
}
},
methods: {
// 展开收起
expandFn () {
this.expand = !this.expand
},
// 获取item 输入框 的个数
getItemNum () {
const items = document
.getElementById('gl-search')
.getElementsByClassName('search-item').length
this.itemNum = items
},
// 判断是否有展开收起标志
ifHasExpand (nowCol) {
if (this.itemNum > nowCol) {
return true
}
return false
},
// 监听函数
getClientWith () {
if (this.time) clearTimeout(this.time)
this.time = setTimeout(() => {
const clientWidth = document.documentElement.clientWidth
// console.log('clientWidth: ', clientWidth)
if (clientWidth <= 800) {
// 1列
this.hasExpand = this.ifHasExpand(1)
} else if (clientWidth <= 1440 && clientWidth > 800) {
// 2列
this.hasExpand = this.ifHasExpand(2)
} else if (clientWidth <= 1720 && clientWidth > 1440) {
// 3列
this.hasExpand = this.ifHasExpand(3)
} else {
// 4列
this.hasExpand = this.ifHasExpand(4)
}
}, 300)
},
handleOk () {
// 点击确定的回调
this.$emit('onOk')
},
handleRest () {
// 点击重置的回调
this.$emit('onRest')
}
},
components: {},
watch: {},
beforeDestroy () {
window.removeEventListener('resize', this.getClientWith, false)
this.time = null
}
}
</script>
<style lang="scss">
.gl-search {
&.transTo {
height: 52px;
}
display: flex;
justify-content: space-between;
overflow: hidden;
@media screen and (max-width: 1062px) {
.search-list {
.search-item {
width: 100%;
}
}
}
@media screen and (min-width: 1062px) and (max-width: 1440px) {
.search-list {
.search-item {
width: 50%;
}
}
}
@media screen and (min-width: 1440px) and (max-width: 1720px) {
.search-list {
.search-item {
width: 33.33%;
}
}
}
@media screen and (min-width: 1720px) {
.search-list {
.search-item {
width: 25%;
}
}
}
.search-list {
flex: 1;
display: flex;
flex-wrap: wrap;
.search-item {
// flex: 1;
// padding-right: 12px;
margin-bottom: 20px;
min-width: 276px;
display: flex;
align-items: center;
box-sizing: border-box;
.name {
width: 112px;
text-align: right;
}
.input {
flex: 1;
// width:100%;
}
.el-input {
width: 100%;
}
.el-select {
width: 100%;
}
.el-date-editor {
width: 100%;
}
}
}
.gl-operate {
display: flex;
align-items: flex-end;
.operate {
text-align: left;
width: 190px;
margin-bottom: 20px;
.expand {
font-size: 14px;
}
.el-button + .el-button {
margin-left: 8px;
}
}
}
}
</style>
import GLSearchItem from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearchItem.install = function(Vue) {
Vue.component(GLSearchItem.name, GLSearchItem)
}
// 默认导出组件
export default GLSearchItem
\ No newline at end of file \ No newline at end of file
<template>
<div :style="{ 'padding-right': spacer + 'px' }" class="search-item">
<div class="name">
<!-- {{ label }} -->
<!-- name 插槽 -->
<slot name="name"></slot>
</div>
<div class="input">
<!-- 默认插槽 -->
<slot></slot>
<!-- <el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input> -->
</div>
</div>
</template>
<script>
export default {
name: 'GLSearchItem',
props: {
// 每个项间隙
spacer: {
type: Number,
default: 12
}
},
data () {
return {}
},
created () {},
mounted () {},
computed: {},
methods: {},
components: {},
watch: {}
}
</script>
import GlTableSearch from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GlTableSearch.install = function(Vue) {
Vue.component(GlTableSearch.name, GlTableSearch)
}
// 默认导出组件
export default GlTableSearch
\ No newline at end of file \ No newline at end of file
<template>
<div class="gl-table-search" :class="operateText?'':'gl-tableh56'">
<div class="gl-search">
<div class="gl-search-right">
<i class="gl-right-icon">*</i>
标签文本栏:
</div>
<div class="gl-search-left">
<el-input size="medium" placeholder="请输入内容" suffix-icon="el-icon-date" v-model="input2"></el-input>
</div>
</div>
<div class="gl-search">
<div class="gl-search-right">
<i class="gl-right-icon">*</i>
标签文本栏:
</div>
<div class="gl-search-left">
<el-input size="medium" placeholder="请输入内容" suffix-icon="el-icon-date" v-model="input2"></el-input>
</div>
</div>
<div class="gl-search-btn">
<el-button size="small" plain>重置</el-button>
<el-button size="small" type="primary">查询</el-button>
</div>
<div class="gl-operate" @click="opeOrCloseFn">
<span class="gl-operate-text">{{operateText?'收起':'展开'}}</span>
<i :class="operateText? 'el-icon-arrow-up':'el-icon-arrow-down'"></i>
</div>
</div>
</template>
<script>
export default {
name: 'GlTableSearch',
props: {},
data() {
return {
input2: '',
operateText:false
}
},
created() {},
mounted() {},
methods: {
opeOrCloseFn(){
this.operateText = !this.operateText
}
},
components: {},
computed: {}
}
</script>
<style lang='scss'>
.gl-table-search {
// padding-bottom: 20px;
&.gl-tableh56{
height:56px;
}
display: flex;
align-items: flex-start;
height:200px;
.gl-search {
padding-bottom: 20px;
width: 100%;
display: flex;
align-items: center;
.gl-search-right {
width: 118px;
text-align: right;
.gl-right-icon {
color: #eb4e4e;
}
}
.gl-search-left {
flex: 1;
min-width: 136px;
}
}
.gl-search-btn{
height: 36px;
padding-top:2px;
padding-bottom:2px;
display: flex;
padding-left: 30px;
padding-right: 20px;
box-sizing: border-box;
.el-button+.el-button{
margin-left: 12px;
}
}
.gl-operate{
width: 130px;
height: 36px;
display: flex;
align-items: center;
color: $color-primary;
cursor: pointer;
.gl-operate-text{
margin-right: 5px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -112,9 +112,16 @@ ...@@ -112,9 +112,16 @@
<div v-if="demo1"> <div v-if="demo1">
```html ```vue
<template> <template>
<GLTable ref="liveRoomRef" :tableParams="tableParams" :tableData="tableData" :tableTotal="100" header-row-class-name="header-row" @row-click="handleRowClick" :paginationattrs="paginationattrs" :paginationlisteners="paginationlisteners"></GLTable> <GLTable ref="liveRoomRef"
:tableParams="tableParams"
:tableData="tableData"
:tableTotal="100"
header-row-class-name="header-row"
@row-click="handleRowClick"
:paginationattrs="paginationattrs"
:paginationlisteners="paginationlisteners"></GLTable>
</template> </template>
<script> <script>
export default { export default {
......
...@@ -144,11 +144,8 @@ export default { ...@@ -144,11 +144,8 @@ export default {
// 搜索前操作 // 搜索前操作
beforeSearchFn: { beforeSearchFn: {
type: Function, type: Function,
default: () => { // 默认值是:Function
return new Promise((resolve, reject) => { default: () => {return new Promise((resolve, reject) => { resolve()})}
resolve()
})
}
}, },
pageSizes: { pageSizes: {
type: Array, type: Array,
...@@ -177,6 +174,7 @@ export default { ...@@ -177,6 +174,7 @@ export default {
type: Boolean, type: Boolean,
default: true default: true
}, },
// table的配置项参数
tableParams: { tableParams: {
type: Object, type: Object,
default: () => { default: () => {
...@@ -215,6 +213,16 @@ export default { ...@@ -215,6 +213,16 @@ export default {
tableColumns: { tableColumns: {
type: Array, type: Array,
default: () => [] default: () => []
},
// 表格项属性穿透
columnattrs:{
type: Object,
default: () => ({})
},
// 表格项事件穿透
columnlisteners:{
type: Object,
default: () => ({})
} }
} }
} }
......
<template> <template>
<div class="testcomp"> <div class="testcomp">
<el-button @click="btnClick" v-bind="$attrs" v-on="$listeners"> <el-button @click="btnClick" v-bind="$attrs" v-on="$listeners">
<!-- 插槽 --> <!-- 默认插槽 -->
<slot></slot> <slot></slot>
</el-button> </el-button>
</div> </div>
...@@ -11,14 +11,16 @@ ...@@ -11,14 +11,16 @@
export default { export default {
name:'TestComp', name:'TestComp',
props:{ props:{
// 类型的种类 `medium` / `small` / `mini` // 类型的种类
demosize:{ demosize:{
type:String, type:String,
// `medium` / `small` / `mini`
default:'medium' default:'medium'
}, },
// `primary` / `success` // demo类型
demotype:{ demotype:{
type:String, type:String,
// `primary` / `success`
default:'primary' default:'primary'
} }
......
// // 导入颜色选择器组件
// 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 * new line
*/ */
// 导入颜色选择器组件 // 导入颜色选择器组件
// import '@/plugins/element.js' // import '@/plugins/element.js'
import {Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip} from '@/plugins/element.js' import { Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip, Icon, Select, Option, DatePicker } from '@/plugins/element.js'
import '@/theme/theme.scss' import '@/theme/theme.scss'
// test 组件 // test 组件
...@@ -41,14 +15,16 @@ import GLButton from './Button' ...@@ -41,14 +15,16 @@ import GLButton from './Button'
import GLDialog from './Dialog' import GLDialog from './Dialog'
import GLTable from './Table' import GLTable from './Table'
import GLFooter from './Footer' import GLFooter from './Footer'
import GlSearch from './GlSearch'
import GlSearchItem from './GlSearchItem'
// 一次性注册所有的过滤器 本地测试 // 一次性注册所有的过滤器 本地测试
import filters from '@/filters' import filters from '@/filters'
//el原始组件 //el原始组件
const ElComponent =[Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip] const ElComponent = [Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip, Icon, Select, Option, DatePicker]
// 存储组件列表 // 存储组件列表
const components = [TestComp, GLExternal, GLButton, GLDialog, GLTable, GLFooter].concat(ElComponent) const components = [TestComp, GLExternal, GLButton, GLDialog, GLTable, GLFooter, GlSearch, GlSearchItem].concat(ElComponent)
// console.log('components: ', components); // console.log('components: ', components);
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册 // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
...@@ -76,5 +52,7 @@ export default { ...@@ -76,5 +52,7 @@ export default {
GLButton, GLButton,
GLDialog, GLDialog,
GLTable, GLTable,
GLFooter GLFooter,
GlSearch,
GlSearchItem
} }
// import Vue from 'vue'
// import 'element-ui/lib/theme-chalk/index.css'
// 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 * new line 2021-12-15
* *
*/ */
import Vue from 'vue' import Vue from 'vue'
import { Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip,Icon } from 'element-ui' import { Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip, Icon, Select, Option, DatePicker } from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css' //todo 按需引入插件样式 // import 'element-ui/lib/theme-chalk/index.css' //todo 按需引入插件样式
import 'element-ui/lib/theme-chalk/table.css' import 'element-ui/lib/theme-chalk/table.css'
import 'element-ui/lib/theme-chalk/table-column.css' import 'element-ui/lib/theme-chalk/table-column.css'
...@@ -29,6 +18,9 @@ import 'element-ui/lib/theme-chalk/form-item.css' ...@@ -29,6 +18,9 @@ import 'element-ui/lib/theme-chalk/form-item.css'
import 'element-ui/lib/theme-chalk/pagination.css' import 'element-ui/lib/theme-chalk/pagination.css'
import 'element-ui/lib/theme-chalk/tooltip.css' import 'element-ui/lib/theme-chalk/tooltip.css'
import 'element-ui/lib/theme-chalk/icon.css' import 'element-ui/lib/theme-chalk/icon.css'
import 'element-ui/lib/theme-chalk/select.css'
import 'element-ui/lib/theme-chalk/option.css'
import 'element-ui/lib/theme-chalk/date-picker.css'
// 解决 ElTable 自动宽度高度导致的「ResizeObserver loop limit exceeded」问题 // 解决 ElTable 自动宽度高度导致的「ResizeObserver loop limit exceeded」问题
const fixElTableErr = table => { const fixElTableErr = table => {
...@@ -39,7 +31,6 @@ const fixElTableErr = table => { ...@@ -39,7 +31,6 @@ const fixElTableErr = table => {
} }
fixElTableErr(Table) fixElTableErr(Table)
Vue.use(Table) Vue.use(Table)
Vue.use(TableColumn) Vue.use(TableColumn)
Vue.use(Popover) Vue.use(Popover)
...@@ -52,8 +43,9 @@ Vue.use(FormItem) ...@@ -52,8 +43,9 @@ Vue.use(FormItem)
Vue.use(Pagination) Vue.use(Pagination)
Vue.use(Tooltip) Vue.use(Tooltip)
Vue.use(Icon) Vue.use(Icon)
Vue.use(Select)
Vue.use(Option)
Vue.use(DatePicker)
//打包后的组件dist 测试组件可能需要的 //打包后的组件dist 测试组件可能需要的
export { export { Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip, Icon, Select, Option, DatePicker }
Table, TableColumn, Popover, Button, ButtonGroup, Loading, Input, Form, FormItem, Pagination, Tooltip, Icon
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!