0.0.47 • Published 2 years ago

thor-xc v0.0.47

Weekly downloads
165
License
-
Repository
-
Last release
2 years ago

THOR雷神UI

We are SuperHero!

THOR-X

DEMO

http://ly.apcan.cn

使用

1.安装组件库

npm i thor-xc --save

2.配置main.js

import thor from 'thor-x'
import 'thor-x/dist/index.css'
Vue.use(thor)

注:也可以不在main.js里引入,在具体页面按需引入相关组件

聊天组件 th-message

<th-message 
  ref="messgebox"
  :useText="true"
  :usePulldown="true"
  :pulldownConfig="pulldownconfig"
  :topPadding="120"
  :messageData="messageData" 
  :funcList="funclist" 
  :bigBtn="bigbtn"
  :showInput="showinput"
  :selfFace="selfface" 
  :otherFace="otherface"
  :showEmoticon="true"
  @sendOut="senRequest"
  @galleryCall="gallery"
  @cameraCall="camera"
  @quickCall="quick"
  @bigBtnCall="btncall"
  @faceClick="faceclick"
  @msgClick="msgclick"
  @pulldownCall="pulldowncall"
  >
</th-message>

API

addQuickMessage(text) 进入输入框状态并插入text文字, 使用示例:this.$refs.messgebox.addQuickMessage('文字内容')

Props

PropRequiredDefault ValueDescription
useTextfalsefalse控制是否开启textarea输入提交模式
topPaddingfalse0顶部间距。若顶部有其他功能块,可以设置顶部间距,数值为该功能块高度,只支持正整数.
messageDatatrue{type:type,text:text,isimg:isimg}聊天记录。type: 4种形式 type=1 右侧泡泡 type=2 左侧泡泡 type=3 消息提示 type=4 系统消息;text: html信息(支持html标签);isimg: 是否为图片信息 true/false,默认false.
funcListtrue功能列表。数组形式 可传"gallery","camera", "quick","guahao",传几个显示几个
bigBtnfalsestring底部显示大按钮。应用场景比如前往评价之类的,必须传string类型,传入文字既按钮显示文字
showInputfalsetrue是否显示聊天输入框。默认true,传入false则输入框不显示
selfFacefalseurl发送方的头像,默认显示默认图
otherFacefalseurl接收方的头像,默认显示默认图
usePulldownfalsefalse配置是否开启下拉刷新功能
pulldownConfigfalse{default: html,up: html,down: html,loading: html}下拉刷新配置。可配置4个参数:default/up/down/loading,支持传入html
showEmoticontruefalse配置是否使用表情包
fromTopfalsefalse配置初始置顶
textTitlefalsefalsetext模式时标题显示字段

Events

EventRequiredDefault ValueDescription
pulldownCallfalsefunction下拉刷新后调用的方法,发起请求更新数据,更新数据完毕调用resetpulldown方法
sendOutfalse点击发送时调用方法
galleryCallfalse点击相册时调用方法,funcList参数里有"gallery"时生效
cameraCallfalse点击拍照时调用方法,同上
quickCallfalse点击快捷回复时调用方法,同上
guahaoCallfalse点击预约挂号时调用方法,同上
bigBtnCallfalse点击底部大按钮时调用方法,传bigBtn参数时生效,绑定按钮点击方法
faceClickfalse点击头像时触发事件
msgClickfalse点击信息时触发事件

Methods

MethodRequiredDescription
resetpulldownfalse下拉刷新完成后重置状态
messageResetfalse手动刷新聊天容器(传输图片时使用)
scrollToTopfalse手动置顶

人物信息组件 th-doctortitlebar

<th-doctortitlebar
  canopen
  :name="doctorbar.name"
  :position="doctorbar.position"
  :star="doctorbar.star"
  :btn="doctorbar.btn"
  :btnType="doctorbar.btntype"
  :btnCanClick="doctorbar.btncanlick"
  :headImg="otherface"
  :clock="`48小时后截止`"
  :isopen="true"
  @btnCall="topbtncall"
  @headClick="headclick"
  @HealthClick="HealthClick"
  :showHealth="true">
  自定义内容
</th-doctortitlebar>

API

Props

PropRequiredDefault ValueDescription
canopenfalsefalse是否显示展开收起按钮
openConfigfalse{open: "展开",close: "收起"}展开功能参数配置。可配置2个参数:open/close
nametrue姓名字段
positiontrue职称字段
starfalsenumber星级字段(1~5)
btnfalsefalse是否显示右侧按钮,默认不显示,传布尔值
btnTypefalsestring按钮类型,可选值为 default,primary,warn
btnCanClickfalsetrue按钮是否能点击,默认可以点击
headImgfalseurl头像图片,默认显示默认图
clockfalse时钟字段,内容自定义
isopenfalse控制展开收起面板默认打开或关闭
showHealthfalsefalse显示健康档案链接
purposeListfalse[]咨询目的数组,如"咨询目的"

Events

EventRequiredDefault ValueDescription
btnCallfalsefunction点击按钮时调用方法
headClickfalse点击头像调用方法
HealthClickfalse点击健康档案调用方法

弹出层 th-dialog

<th-dialog 
  :isShow.sync="showdialog" 
  :showFrom="dialogfrom" 
  :closeOnClickshadow="true" 
  @onHide="hidedialog">
</th-dialog>

API

Props

PropRequiredDefault ValueDescription
isShowtruetrue控制是否显示
showFromfalsebottom控制出现方式:top/bottom
closeOnClickshadowfalsefalse控制点击背景黑色是否关闭

Events

EventRequiredDefault ValueDescription
onHidefalsefunction关闭时调用的方法

文本滚动 th-marquee

<div style="width: 100px;">
  <th-marquee 
    content="333333333"
    speed="middle">
  </th-marquee>
</div>

API

Props

PropRequiredDefault ValueDescription
contentfalse暂无内容显示内容
speedfalsemiddle控制滚动速度:quick/middle/slow

说明:需要一个外部容器限制宽度,才能实现滚动效果。当宽度大于实际内容,不滚动。

0.0.47

2 years ago

0.0.45

3 years ago

0.0.46

3 years ago

0.0.44

3 years ago

0.0.43

3 years ago

0.0.42

3 years ago

0.0.41

3 years ago

0.0.40

3 years ago

0.0.39

3 years ago

0.0.38

4 years ago

0.0.37

4 years ago

0.0.36

4 years ago

0.0.35

4 years ago

0.0.34

4 years ago

0.0.33

4 years ago

0.0.32

4 years ago

0.0.30

4 years ago

0.0.31

4 years ago

0.0.29

4 years ago

0.0.27

4 years ago

0.0.28

4 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago