0.2.1 • Published 2 years ago
cyt-pl-plug v0.2.1
cyt-pl-plug
安装使用 1、npm install cyt-pl-plug -S 安装该依赖
2、全局引入(main.js)
import Account from "cyt-pl-plugs";
Vue.use(Account);
3、按需引入(组件内使用)
import { Account } from "cyt-pl-plug";
export default {
components: {
Account,
},
};
4、配置项目说明
buyerAccountList 服务端获取的买手号信息列表
数据结构为
[
{
id: 12081,
uid: 527939,
uuid: 0,
type: 3,
name: "愤怒的毒王",
password: "",
login_info: "[]",
note: "",
cache_path: "ShotOrderAccount\\TaoBao\\637686148863307423",
ua: "",
created_at: "2021-09-30 16:08:29",
},
];
operation 配置项
<buyAccount ref="buyAccount " :buyer-account-list="buyerAccountList" :operation="operation" />
operation 不传为默认配置:
operation: {
left: [{ title: '登录买手号', type: 'primary', key: 1 }],
center: [
{ title: '拼多多账号', platform: 1 },
{ title: '淘宝账号', platform: 3 },
{ title: '1688 账号', platform: 8 },
{ title: '京喜账号', platform: 10 }
],
right: [
{ title: '拼多多优惠券', key: 2 },
{ title: '下载账号信息', key: 3 }
]
},
参数详情
left(左边按钮)
- title:按钮名称
- click:调用外层函数的名称
- type:基于 element 的 按钮 type 默认为 plain
- size:基于 element 的 按钮 size 默认为 mini
- key:组件内方法 1 打开买手号方法 2 拼多多优惠卷方法 3 下载账号方法(有 key 时默认会覆盖 click)
center(中间买手号管理)
title:买手号名称
- platform:平台类型 1 拼多多 3 淘宝 8 1688 10 京喜
- right(右边按钮)与左边按钮使用一致
组件方法
accountChange() 能获取到所有买手号选择的 id
用法:this.\$refs.buyAccount.accountChange()
返回一个 Object
案例
{
"accountpdd": 10675,
"accounttaobao": 12081,
"account1688": "",
"accountjx": ""
}
日志组件使用 1、npm install cyt-pl-plug -S 安装该依赖
2、全局引入(main.js)
import Logs from "cyt-pl-plug";
Vue.use(Logs);
3、按需引入(组件内使用)
import { Logs } from "cyt-pl-plug";
export default {
components: {
Logs,
},
};
4、在组件中使用
<Logs ref="Logs " v-model="showConsole" />
- showConsole 绑定值(Boolean)是否显示日志
5、配置项目说明
<Logs ref="Logs " v-model="showConsole" clear />
clear:是否有清除日志按钮 6、输出日志方法
this.\$refs.Logs.writeLog(msg,colorSetting)
msg:字符串(日志内容)
- colorSetting:(Boolean) 传 Boolean 类型默认是 green 和 red 色 传字符串'black'自定义颜色
7、清除日志方法
- this.\$refs.Logs.clears()