0.3.6 • Published 2 years ago

wy-music-ui v0.3.6

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

wym-ui

这是一个基于网易云音乐移动端的组件库

使用

npm install wy-music-ui

yarn add wy-music-ui

引入

在main文件引入

// 引入样式
import 'wy-music-ui/lib/packages.css'

import wymui from 'wy-music-ui'
app.use(wymui)

具体组件效果可以把https://github.com/zhan-hc/wym-ui.git仓库克隆下来,跑起来,在路由/demo/index 看效果

组件

按钮button

<wym-button>我是按钮</wym-button>
<wym-button round>我是按钮</wym-button>
<wym-button size="large">我是按钮</wym-button>
<wym-button size="large" round disabled>我是按钮</wym-button>
参数说明默认值
round圆角false
size尺寸 可选large-
disabled置灰false

弹窗dialog

  const { appContext } = getCurrentInstance()
  const proxy = appContext.config.globalProperties
  proxy.$dialog({
    title: '',
    message: '',
    confirmBtnText: '',
    cancelBtnText: ''
  }).then(() => {
    console.log('confirm')
  }).catch(() => {
    console.log('cancel')
  })
参数说明默认值
title标题提示
message内容这是一个弹出框,代码是写出来给人看的,附带能在机器上运行。
confirmBtnText确认文案确认
cancelBtnText取消文案取消

图标icon

  <wymIcon :name="bofang" size="24px" color="blue"/>
参数说明默认值
name图标名称-(必传)
size图标尺寸16px
color图标颜色#fff

loading

  const { appContext } = getCurrentInstance()
  const proxy = appContext.config.globalProperties
  proxy.$loading({ type: 'music', position: 'center' }).show()
  proxy.$loading('正在加载中...').show()
参数说明默认值
type类型 可选 normal/music/primarynormal
position展示位置 可选 top/bottom/centertop
messageloading文案-

toast

  const { appContext } = getCurrentInstance()
  const proxy = appContext.config.globalProperties
  proxy.$toast('toast提示')
  proxy.$toast({message: 'toast提示内容', duration: 0})
参数说明默认值
message提示信息-
duration显示时长-

duration为0表示不消失,需要通过$toast().clear()手动清除


进度条progress

  <!-- 默认进度条 -->
  <wym-progress
    v-model:percentage="50"
    :strokeWidth="5"
    color="#1989fa"
  />
  <!-- 圆环进度条 -->
  <wym-progress
    type="circle"
    percentage="percentage"
    :strokeWidth="5"
    size="100"
    round
  >
    {{percentage}}%
  </wym-progress>
参数说明默认值
type类型 可选 normal/circle(圆环进度条)normal
v-model:percentage进度百分比0
strokeWidth进度条粗细2
color进度条颜色#fff
pivot-color进度条点的颜色#000
track-color轨道颜色#000
size圆环进度条的直径50
round圆环进度条的圆角false
click-event是否支持点击移动进度条(默认进度条特有)false
drag-event是否支持点击拖拽移动进度条(默认进度条特有)false

** 插槽slot | 名称 | 说明 | | ---- | ---- | | default| 自定义内容(圆环进度条特有) |

** 事件event | 名称 | 说明 | | ---- | ---- | | percentChange| 进度点击变化或结束拖动后触发 |


滚动容器scrollview

只支持水平滚动

  <wym-scroll-view></wym-scroll-view>

歌曲songitem

  <wym-song-item :data="data"></wym-song-item>

  const data = {
    imageUrl:
      'https://img2.baidu.com/it/u=176772482,3633072556&fm=253&fmt=auto&app=120&f=JPEG?w=647&h=500',
    title: '孤勇者',
    authors: '陈奕迅',
    desc: '儿童最爱听',
    subTitle: '超72%人播放',
  }

data | 参数 | 说明 | 默认值 | | ---- | ---- | ---- | | imageUrl | 歌曲图片 | - | | title | 歌曲名称 | - | | authors | 歌曲作者 | - | | desc | 歌曲描述 | - | | icon | 图标({name,size,color}) | {name:bofang2,color: '#fff'} | | subTitle | 歌曲副标题 | -(非必传) |


歌单songsheet

  <wym-song-sheet :data="data"></wym-song-sheet>
  <wym-song-sheet :data="data" width="70px" height="70px"></wym-song-sheet>

  const data = {
    playCount: 1500000,
    imageUrl:
      'https://img2.baidu.com/it/u=176772482,3633072556&fm=253&fmt=auto&app=120&f=JPEG?w=647&h=500',
    title: '好听到可以单曲循环吖',
  }
参数说明默认值
width歌单宽度100px
height歌单高度100px
data参数说明默认值
imageUrl歌单图片-
title歌单名称-
icon图标({name,size,color}){name:bofang4, color: '#fff', size: '12px'}
playCount歌单播放量-
0.1.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.1.2

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.3.6

2 years ago

0.2.7

2 years ago

0.1.8

2 years ago

0.3.5

2 years ago

0.2.6

2 years ago

0.1.7

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.1.9

2 years ago

0.3.2

2 years ago

0.2.3

2 years ago

0.1.4

2 years ago

0.3.1

2 years ago

0.2.2

2 years ago

0.1.3

2 years ago

0.3.4

2 years ago

0.2.5

2 years ago

0.1.6

2 years ago

0.3.3

2 years ago

0.2.4

2 years ago

0.1.5

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago