vue-public

1.0.2 • Public • Published

vue-public

前端公共组件

安装

  • npm install vue-public --save

如何使用$validator

//element 表单验证规则
 import { $validator } from "vue-public";
 Vue.prototype.$validator = $validator;
 <el-form-item prop="key" :rules=[$validator.require(),[$validator.requireChange()]></el-form-item>

如何使用 table

<el-button @click="serachList">搜索</el-button>

<common-table :queryList="queryList" :pageSize="20" ref="commonTable">
  <template slot="table">
    <!-- 表格内容定义区域 -->
    <el-table-column prop="example" label="案例"></el-table-column>
    ...
  </template>
</common-table>
import { commonTable, request } from "vue-public";
export default {
   components:{
    commonTable
   }
   methods: {
     //列表请求接口
    queryList(param) {
      return request({
        url:"http://example.com",
        method: "post",
        data: {
          ...param,
          //name: this.name
        }
      });
    },
    // 列表搜索
    serachList() {
      this.$refs.commonTable.getList();
    }
  }
}

Readme

Keywords

Package Sidebar

Install

npm i vue-public

Weekly Downloads

3

Version

1.0.2

License

ISC

Unpacked Size

6.98 kB

Total Files

6

Last publish

Collaborators

  • jiagujin