1.1.18 • Published 3 years ago

webkf-core-lookup v1.1.18

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

介绍

webkf-core-lookUp 码表控件

更新日志

安装教程

# 指定npm服务器
npm set registry http://www.xhzq.com:4873
# 安装依赖包
npm i webkf-core-lookup -S
# 查看更新版本
npm view webkf-core-lookup versions
# 更新到指定版本
npm install webkf-core-lookup@X.X.X

1. 属性

参数说明类型可选值默认值
config配置Boolean-true
size大小Boolean-true
value表格调试模式Boolean-true
columnDefs列定义Boolean-false
rowData行数据Boolean-false
bindColumn使用整行分组Boolean-false
allowGridConfig允许表格配置Boolean-false
gridConfig表格配置Boolean-false
isReadonly是否只读Boolean-false

2. 事件

方法名说明

3. 方法

方法名说明返回类型参数默认值
getvalue获得值Object--
clearInput清空Void--

v-model 新增表格配置

      表格配置参数可以和表格属性混用
      表格配置参数不包括 'rowData' 属性
      如果表格配置参数属性与表格属性相同时表格配置属性生效
      
      :allowGridConfig="true"   //是否启用表格配置参数
      :gridConfig="gridConfig"  //表格配置参数
      
      DEMO
       this.gridConfig = {
            'showToolbar': true,
            'defaultColDef': this.defaultColDef,
            'columnDefs': this.columnDefs,
            'rowSelection': this.rowSelection,
            'frameworkComponents': this.frameworkComponents,
            'treeData': true,
            'getDataPath': this.getDataPath,
            'animateRows': true,
            'autoGroupColumnDef': this.autoGroupColumnDef,
            'gridOptions': this.gridOptions
          }
      

v-model 使用方法

    v-model="testData"    // 绑定的id
    :config="config"   // 绑定配置

  #data: {
   testData: 1
   config: {
          id: 'id', // 要绑定id 的字段
          label: 'label'  // 要显示的字段
        },
  }

  # 返回行数据,不需要行数据可忽略
  @getvalue 更改为,返回当前行数据
   methods: {
      getvalue (data) {
        this.rowItem = data
      }
    }

更新日志

解决离开无法自动收起BUG

使用方法

# 使用弹窗
import lookUp from 'webkf-core-lookup'

// 全局引用
Vue.component(lookUp.name, lookUp)
// 局部引用
  components: {
    lookUp
  }

##test.vue

<template>
    <lookUp
    style="height: 50px;width:300px;"
    :inputText="testData"
    :columnDefs="columnDefs"
    :rowData="rowData"
    @RetrueData="getvalue"
    ></lookUp>
</template>

<script>
import lookUp from '@/lib'
export default {
  name: 'index',
  data () {
    return {
      testData: '',
      columnDefs: [
        {headerName: 'Make', field: 'make'},
        {headerName: 'Model', field: 'model'}
      ],
      rowData: [
        { make: 'Toyota1', model: 'Celica' },
        { make: 'Ford', model: 'Mondeo' },
        { make: 'Porsche', model: 'Boxter' }
      ]
    }
  },
  components: {
    lookUp
  },
  methods: {
    getvalue (data) {
      this.testData = data.make
    }
  }
}
</script>

<style scoped>

</style>