yc-ui2 v0.2.1-beta5
使用
安装命令:npm install yc-ui2
main.js 导入
import Ycui2 from 'yc-ui2'
import "yc-ui2/dist/yc-ui2.css"
Vue.use(Ycui2)
组件
Name | Describe |
---|---|
YcSlideVerify | 滑动验证 |
YcCustomerService YcQuestion | 小优客服 |
YcCA | CA组件 |
yc-slide-verify
滑动验证
vue.config.js
proxy: {
// 在proxy中添加以下代码
['/cloud-img']: {
target: `http://***:***/cloud-img/`,
changeOrigin: true,
pathRewrite: {
["^/cloud-img"]: "",
},
},
}
<yc-slide-verify
:isShow.sync="isShow"
@success="handleLogin"
/>
Param | Type | Describe |
---|---|---|
title | String | 滑动验证 |
isShow | Boolean | 是否显示 |
success | Function | 成功回调 |
close | Function | 关闭显示 |
yc-customer-service
小优客服右角展示
vue.config.js
proxy: {
// 在proxy中添加以下代码
['/customer-api']: {
target: `http://***:***`,
changeOrigin: true,
pathRewrite: {
["^/customer-api"]: "",
},
},
}
<yc-customer-service
:id=""
:title=""
:tokenName=""
jumpPage="/question"
hotlineService="客服热线" // 可不传,默认:客服热线
>
<!-- 定制化插槽部分 -->
<div>
<!-- 第一个div内容 右下角显示图片 -->
<i class="el-icon-mobile"></i>
</div>
<div>
<!-- 第二个div内容 鼠标放入第一个div会提示以下部分 -->
<span>客服热线</span>
<a href="tel:***">***</a>
<template v-if="!['/login', '/register'].includes($route.path)">
<span style="margin-top: 10px">***服务电话</span>
<a href="tel:***">***(***)</a>
<a href="tel:***">***(***)</a>
</template>
</div>
</yc-customer-service>
Param | Type | Describe |
---|---|---|
id | Number | 服务id |
title | String | 服务标题 |
tokenName | String | token名称 |
jumpPage | String | 展开跳转客服页面 |
hotlineService | String | 右下角显示文字(可不传,默认:客服热线) |
yc-question
小优客服页面
需要在白名单中添加 /question 页面;有的在 permission.js 有的在router中
const whiteList = ['/login', '......', '/question']
路由中需要配置 yc-customer-service组件中jumpPage参数跳转的页面 router/index.js 路由中添加以下部分
{
path: "/question", //yc-customer-service组件中jumpPage参数保持一致
component: (resolve) => require(["@/views/question"], resolve),
hidden: true,
},
根据自己编写的路由文件创建文件:views/question.vue 新创建的question.vue 中加入以下代码
<template> <YcQuestion :id="" :title="" :commit="" :tokenName="" </YcQuestion> </template>
Param | Type | Describe |
---|---|---|
id | Number | 服务id |
title | String | 服务Name |
commit | String | 描述 |
tokenName | String | token名称 |
YcCA
CA组件
<template>
<YcCA :region="region" @caSuccess="login" />
</template>
Param | Type | Describe |
---|---|---|
region | Number | CA地区类型 |
caSuccess | Function | CA成功回调方法 |
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago