1.0.8 • Published 11 months ago

muz-doraemon v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

Muz Doraemon 哆啦 A 梦

哆啦 A 梦。基于 Uni-App 的 VUE3 组件库——Жидзин(Zidjin)矢争系列组件库。

注意:文档编撰格式参考 Element UI 组件文档。

安装

推荐使用 npm 的方式安装。

npm install muz-doraemon

引入

全局引入,在 pages.json 中写入以下内容:

{
    "pages": [],
    "globalStyle": {
        "navigationStyle": "custom" // 启用自定义导航条
    },
    "easycom": {
        "autoscan": true, // 自动查找安装、引用、注册符合“components/组件名称/组件名称.vue”目录结构的组件。
        "custom": {
            "^muz-(.*)": "muz-doraemon/src/muz-$1/muz-$1.vue" // 自定义组件正则匹配规则,如果需要匹配node_modules内的vue文件,需要使用packageName/path/to/vue-file-$1.vue形式的匹配规则
        }
    }
}

局部引入,在 vue 页面文件中写入以下内容

import {MuzItem, MuzListArea, ...} from 'muz-doraemon';
export default {
    components: {
        MuzItem,
		MuzListArea,
		...
    },
};

Doraemon 哆啦 A 梦

哆啦 A 梦的组件百宝箱。

基础用法

^图像示例: 注:图像示例统一 800×300 像素,特殊除外。

<template>
    <muz-doraemon :list="list"></muz-doraemon>
</template>

<script>
import {MuzDoraemon} from 'muz-doraemon';
export default {
    data: ()=>({
        list: [
            ...
        ],
    })
};
</script>

UML 流程图

Doraemon Attributes

参数说明类型可选值默认值
root-url根域名。小程序/APP 需要添加域名string
share-info分享信息object{}
page-param传入页面参数,用于定制化不同页面过滤结果object{page,id,nav,page}
list组件化的列表配置array
editable启用编辑适用:tl-formbooleantruefalse

Option of List

参数说明类型可选值默认值
show是否显示booleanfalsetrue
component组件名称。符合渲染配置化的组件。stringmuz-divider, muz-background, muz-tab-bar, muz-classify, muz-item, muz-list-area, muz-item-areamuz-order-bartl-form
classes自定义类名string
styles自定义样式。作用于组件根标签。object例:{fontSize: "14px",},
config组件配置。详见本文组件。object
list适用:muz-classify分类列表array详见 muz-classify 组件
item适用:muz-item条数据模版object详见 muz-item 组件
itemTemplate适用:muz-list-area,     muz-item-area条数据模版。详见:Item 条数据object详见 muz-item 组件
itemTemplateSet适用:muz-list-area条数据模版集合。object<name, object>详见 muz-item 组件
request适用:muz-list-area,     muz-item-area组件数据请求配置object详见:muz-list-area Option of Request (请求选项)
optionsRequest适用:muz-list-area,     muz-item-area多组选项的请求配置array详见:muz-list-area Option of Request (请求选项)

Doraemon Slot

名称说明
新版已弃用,原因:不支持小程序自定义插槽。详见:条数据 .slot

Background 背景

背景组件。

基础用法

^图像示例: 注:图像示例统一 800×300 像素,特殊除外。

<template>
    <muz-background :config="config" />
</template>

<script>
import { ZjTable } from 'zj-element';
export default {
    data: () => ({
        config: {
            backgroundImage: '/images/bg.png',
        },
    }),
};
</script>

Background Attributes

参数说明类型可选值默认值
classes自定义类名string
styles自定义样式object
config组件配置object

Option of Config

参数说明类型可选值默认值
backgroundImage背景图片string

Top-Bar 顶部栏

顶部栏

基础用法

^图像示例: 注:图像示例统一 800×300 像素,特殊除外。

<template>
    <muz-plus-bar title="标题" :is-search="true" />
</template>

<script>
import { ZjTable } from 'zj-element';
export default {
    data: () => ({}),
};
</script>

Nav-Bar Attributes

参数说明类型可选值默认值
title标题sring标题
rtext右侧文件sring
root是否根页,无返回booleantruefalse
is-search是否显示搜索booleantruefalse
is-add是否显示添加booleantruefalse
is-edit是否显示编辑booleantruefalse
is-delete是否显示删除booleantruefalse
is-scan是否显示扫码booleantruefalse
is-fIlter是否显示过滤booleantruefalse
is-more是否显示更多booleantruefalse
is-with是否显示分享???booleantruefalse
is-left-search是否显示右侧搜索booleantruefalse
is-plus是否显示加号booleantruefalse
is-customize是否左侧自定义booleantruefalse
customize-title自定义内容 文字sring
is-off是否显示左侧关闭booleantruefalse
is-dropdown是否显示下拉booleantruefalse
dropdownDelete下拉的删除booleantruefalse
dropdownEdit下拉的编辑booleantruefalse
dropdownWith下拉的分享???booleantruefalse

Tab-Bar 标签栏

标签栏

基础用法

<template>
    <muz-tab-bar v-if="it.component === 'muz-tab-bar'" :default="it.default" :page-param="currentParam" :config="it.config" :request="it.request" @tab="onTab" />
</template>

<script>
export default {
    data: () => ({}),
};
</script>

Tab-Bar Attributes

参数说明类型可选值默认值
classes自定义类名string
styles自定义样式object
default选中高亮显示String, Number
pageParam界面传参数Object
config当前激活的导航按钮Object
request请求导航条配置Object

Option of Config

参数说明类型可选值默认值
nodeLabel节点标签键名stringshow
nodeValue节点值键名stringvalue
nodeShow节点显示键名stringshow
unshiftList头部插入标签列表ArrayObject{value: "全部",} 注意:value 与 valueNode 的值保持一致
appendList尾部插入标签列表ArrayObject{value: "其他",}注意:value 与 valueNode 的值保持一致

Nav-Bar 导航栏

导航栏

基础用法

^图像示例: 注:图像示例统一 800×300 像素,特殊除外。

<template>
    <muz-nav-bar current-nav="home" :nav-list="list"></muz-nav-bar>
</template>

<script>
import {ZjTable} from 'zj-element';
export default {
    data: ()=>({
        list: [
            {
                key: 'home',
                icon: '/static/icons/icon-home.svg',
                activeIcon: '/static/icons/icon-home-color.svg',
                title: '首页',
                url: '/pages/home/home',
            },
            {
                key: 'me',
                icon: '/static/icons/icon-me.svg',
                activeIcon: '/static/icons/icon-me-color.svg',
                title: '我',
                url: '/pages-me/me/me',
            },
        ],
    })
};
</script>

Nav-Bar Attributes

参数说明类型可选值默认值
classes自定义类名string
styles自定义样式object
current-nav当前激活的导航按钮string
current当前激活的下标按钮number-1
nav-list导航条配置array{ key: 'me', icon: '/static/icon-me.svg', activeIcon: '/static/icon-me-color.svg', title: '我', url: '/pages-me/me/me',},
request请求导航条配置
close-url-active关闭自动检查激活即根据 Url 地址匹配激活booleantruefalse
is-tab-mode启用标签,暂时弃用booleantruefalse

Order-Bar 订单栏

订单栏

基础用法

^图像示例: 注:图像示例统一 800×300 像素,特殊除外。

<template>
    <muz-order-bar current-nav="home" :nav-list="list"></muz-nav-bar>
</template>

<script>
import {MuzOrderBar} from 'muz-doraemon';
export default {
    data: ()=>({})
};
</script>

Order Attributes

参数说明类型可选值默认值
classes自定义类名string
styles自定义样式object
item订单条数据配置object详见 muz-item 组件
config配置object
all-checked是否全选booleantruefalse
checked-list已选择列表数据array
page-param页面参数用于接受页面传参object

Option of Config

参数说明类型可选值默认值
height订单栏高度number100
nodePrice价格节点键用于前端统计总价string'price'
nodeKey主键节点键用于生成已选 ID 列表,默认 idstring'id'
fixed小数点位数number2
showCheck是否显示全选框booleantruefalse
openCheckStorage开启全选写入缓存缓存 key 名默认为 checked-listbooleantruefalse
split指定返回已选 ID 列表的分割符string','

Classify 分类图标

分类图标组件。

基础用法

^图像示例: 注:图像示例统一 800×300 像素,特殊除外。

<template>
    <muz-classify :config="it.config" :list="list" @classify="onClassify" />
</template>

<script>
export default {
    data: () => ({
        config: {
            backgroundImage: '/images/bg.png',
        },
    }),
};
</script>

Classify Attributes

参数说明类型可选值默认值
classes自定义类名string
styles自定义样式object
title分类大标题string
subtitle副标题string
config组件配置object
list分类列表array例:{ icon: '/icon/news.svg', text: '投标报价', value: '',},
row每行显示个数number5

Option of Config

参数说明类型可选值默认值
noBorder是否无边booleantruefalse
isCircle是否圆形图标booleantruefalse
isLeftAlign是否左对齐booleantruefalse
thumb图标大小stringmedium / small / minimedium

Option of List

参数说明类型可选值默认值
icon图标地址如果不传则默认显示文本第一个字符string
text文本,分类名称string
subtitle副标题,分类副标题string
to或 url(歧义,将弃用)跳转链接string
emit自定义信号string, object<emit, ...>

Event

事件名称说明回调参数
clicks点击触发,代替 click
classify点击分类图标时触发( item: 目前的点击对象 )
emit点击分类图标时触发( emit: 信号名称, item: 目前的点击对象, config: 信号包配置 )

Divider 分隔行

分隔行组件。

基础用法

^图像示例: 注:图像示例统一 800×300 像素,特殊除外。

<template>
    <muz-divider :config="it.config" />
</template>

<script>
import { ZjTable } from 'zj-element';
export default {
    data: () => ({
        config: {
            backgroundImage: '/images/bg.png',
        },
    }),
};
</script>

Divider Attributes

参数说明类型可选值默认值
classes自定义类名string
styles自定义样式object
config组件配置object

Option of Config

参数说明类型可选值默认值
title分隔行标题string
to或 url(歧义,将弃用)点击标题的跳转地址需启用 clickablestring
backgroundImage背景图片string
clickable启动跳转booleanfalsetrue
mode跳转模式stringredirectnavigate

Menu 菜单列表

菜单列表

基本用法

<template>
    <muz-menu :list="list" thumb-size="medium"></muz-menu>
</template>

<script>
export default {
    data: () => ({
        list: [
            {
                text: '我的发布',
                rightText: '全部',
                icon: '',
                to: '/pages/timeline/timeline',
                config: {
                    noBorder: true,
                    isLeftAlign: true,
                    thumb: 'min',
                },
                children: [
                    {
                        text: '报名中',
                        icon: '/static/icons/icon-bid-clock.svg',
                        to: '',
                    },
                ],
            },
            {
                group: '隐私',
                children: [
                    {
                        text: '俄友圈权限',
                    },
                ],
            },
        ],
    }),
};
</script>

Muz-Menu Attributes

参数说明类型可选值默认值
classes自定义类名string
styles自定义样式object
list分类列表array
thumbSize自定义图标大小object
list-type列表类型stringcard, menumenu
  • list-type 为 card 时,实际调用的是 muz-classify 做为内置组件

Option of List

参数说明类型可选值默认值
groupName分组名称string
icon菜单图标string
text菜单文本string
subtitle副标题string
sidenote右侧旁注string
to跳转路径string
thumbSize图标尺寸stringlarge, medium, small, mini, minmedium
noBorder是否有边框booleantruefalse
config配置项仅适用:详见:Classify 分类图标 “config”object
children子菜单列表同 Option of Listarray

Option of List's Config

参数说明类型可选值默认值
noBorder是否有边框booleantruefalse
isLeftAlign是否左对齐booleantruefalse
thumb跳转路径string

Casket 匣子盒

匣子盒

基本用法

<template>
    <muz-casket :raw-item="item" :open-check="true" :checked="isChecked(item.id)" @checked="onChecked"></muz-casket>
</template>

<script>
export default {
    data: () => ({
        item: {
            id: 23, title: '中华'
        },
        casketSelected:{}
    }),
    computed: {
        isChecked() {
            return id => !!this.casketSelected[id];
        },
    }
};
</script>

Muz-Casket Attributes

参数说明类型可选值默认值
classes自定义类名string
styles自定义样式object
checked选中状态booleantruefalse
open-check开启选框booleantruefalse
node-key指定主键节点名称stringid
raw-item数据源指定匣子需要包裹的数据object
disabled-check待开发
disabled-swipe-action待开发
auto-close待开发
options待开发
duration待开发

Item 条数据

该组件为原生结构式 Vue 组件(struct as data)。

基本用法

<template>
    <muz-item :item="item" @item="onClick" />
</template>

<script>
export default {
    components: {
        MuzItem: () => 'muz-item', // 注:微信小程序不支持此组件懒加载方式
    },
    data: () => ({
        item: {
            title: {
                text: '标题 Один Один',
                hot_tip: '热门',
            },
            bars: [{ type: 'bit', text: '这是文字' }],
        },
    }),
};
</script>

高级用法示例

限定性:1、组件限于展示,不处理复杂逻辑,但有信号事件。2、

<template>
	<muz-item :item="item" @item="onClick" />
</template>

<script>
	export default {
        components: {
            MuzItem: () => 'muz-item',  // 注:微信小程序不支持此组件懒加载方式
        },
        data: () => ({
            item: {
                id: 283576, // 自定义参数,仅用于信号触发的数据传值等
                title: {
                    text: "标题 Один Один", hot_tip: "热门",
                },
                lead: {
                    cover: { url: "http://i.muztak.cn/images/yellow-river.jpg", hot_tip: "棒", },
                    avatar: { url: "http://i.muztak.cn/images/yellow-river.jpg", },
                    bars: [
                        {
                            list:[
                                { type: "title", text: "今天节日活动拼团的,可以过来看看看。Расцветали яблони и груши, Поплыли туманы над рекой.", hot_tip: "热门",},
                            ]
                        },
                        {
                            list:[
                                [
                                    { type: "author", icon: "http://i.muztak.cn/images/yellow-river.jpg", text: "滕户纱织", emit: "author", },
                                    { type: "rank", icon: "http://i.muztak.cn/images/icon-rank.png", },
                                ],
                                [
                                    { type: "price", icon_code: "r", text: 2500, unit: "卢布", emit: "author", },
                                ]
                            ]
                        },
                        {
                            list:[
                                { type: "summary", text: "今天节日活动拼团的,可以过来看看看。Расцветали яблони и груши, Поплыли туманы над рекой. Выходила на берег катюша, На высокий берег на крутой.",},
                            ]
                        },
                        {
                            list:[
                                [
                                    { type: "tags", list: ['同城', '圣诞节'], },
                                ],
                                [
                                    { type: "bit", icon_code: "M", text: 75, label: "共", unit: "评",},
                                    { type: "bit", icon: "http://i.muztak.cn/images/icon-heart.svg", text: 284, label: "共", unit: "赞", emit: "like", },
                                ]
                            ]
                        },
                        {
                            list:[
                                { type: "five-star", text: 4.5, },
                                { type: "time", icon: "http://i.muztak.cn/images/icon-time-color.svg", text: 18357, mode: "timestamp",},
                            ]
                        },
                        {
                            list:[
                                [
                                ],
                                [
                                    { type: "button", text: '电话', color: 'indigo', emit: 'call'},
                                ]
                            ]
                        },
                        {
                            list:[
                                { type: "button", text: '1', color: 'red', emit: 'call1'},
                                { type: "button", text: '2', color: 'orange', emit: 'call2'},
                                { type: "button", text: '3', color: 'green', emit: 'call3'},
                                { type: "button", text: '4', color: 'blue', emit: 'call4'},
                                { type: "button", text: '5', color: 'purple', emit: 'call5'},
                            ]
                        },
                    ],
                },
                video:{
                    text: "黄河水",
                    cover: "http://i.muztak.cn/images/yellow-river.jpg",
                    url: "http://i.muztak.cn/videos/landscape-arctic.mp4",
                    danmuku: [{text: "红色走一波", timestamp: 74848}, ],//弹幕
                },
                swiper: {
                    list: [
                        {
                            url: "http://i.muztak.cn/images/yellow-river.jpg",
                            text: "中国 黄河",
                        },
                        {
                            url: "http://i.muztak.cn/images/landscape-arctic.jpg",
                            text: "俄罗斯 北极",
                        },
                        {
                            url: "http://i.muztak.cn/images/landscape-arctic.jpg",
                            text: "俄罗斯 北极",
                        }
                    ],
                },
                //九图式
                sudoku: {
                    list: [
                        'http://i.muztak.cn/images/landscape-arctic.jpg',
                        'http://i.muztak.cn/images/landscape-arctic.jpg',
                        'http://i.muztak.cn/images/landscape-arctic.jpg',
                        'http://i.muztak.cn/images/landscape-arctic.jpg',
                        'http://i.muztak.cn/images/landscape-arctic.jpg',
                        'http://i.muztak.cn/images/landscape-arctic.jpg',
                        'http://i.muztak.cn/images/landscape-arctic.jpg',
                        'http://i.muztak.cn/images/landscape-arctic.jpg',
                        'http://i.muztak.cn/images/landscape-arctic.jpg',
                        'http://i.muztak.cn/images/landscape-arctic.jpg',
                        'http://i.muztak.cn/images/landscape-arctic.jpg',
                    ],
                },
                //薛定谔式
                schrodinger: {
                    list: [
                        {
                            image: "http://i.muztak.cn/images/avatar-live.jpg",
                            burn: false,   //阅后即焚
                            auth: false,   //授权查看
                            text: '公开照片',  //是否授权
                        },
                        {
                            image: "http://i.muztak.cn/images/avatar-live.jpg",
                            burn: true,   //阅后即焚
                            burned: false, //是否焚毁
                            text: '阅后即焚',  //是否授权
                        },
                        {
                            image: "http://i.muztak.cn/images/avatar-live.jpg",
                            burn: true,   //阅后即焚
                            burned: true, //是否焚毁
                            text: '已焚毁',  //是否授权
                        },
                        {
                            image: "http://i.muztak.cn/images/avatar-live.jpg",
                            auth: true,   //授权查看
                            authed: false,  //是否授权
                            text: '红包',  //是否授权
                        },
                        {
                            image: "http://i.muztak.cn/images/avatar-live.jpg",
                            auth: true,   //授权查看
                            authed: true,  //是否授权
                            text: '已支付',  //是否授权
                        },
                        {
                            image: "http://i.muztak.cn/images/avatar-live.jpg",
                            burn: true,   //阅后即焚
                            auth: true,   //授权查看
                            burned: false, //是否焚毁
                            authed: false,  //是否授权
                            text: '红包阅后即焚',  //是否授权
                            icon: 'http://i.muztak.cn/images/icon-house.svg', // 不写单位也可以放图标
                            price: 12, // 价格
                            unit: '币', // 单位
                        },
                        {
                            image: "http://i.muztak.cn/images/avatar-live.jpg",
                            burn: true,   //阅后即焚
                            auth: true,   //授权查看
                            burned: true, //是否焚毁
                            authed: true,  //是否授权
                            text: '已焚毁',  //是否授权
                        },
                    ],
                },
                //胶卷式
                kodak: {
                    list: [
                        'http://i.muztak.cn/images/yellow-river.jpg',
                        'http://i.muztak.cn/images/yellow-river.jpg',
                        'http://i.muztak.cn/images/yellow-river.jpg',
                        'http://i.muztak.cn/images/yellow-river.jpg',
                        'http://i.muztak.cn/images/yellow-river.jpg',
                        'http://i.muztak.cn/images/yellow-river.jpg',
                        'http://i.muztak.cn/images/yellow-river.jpg',
                        'http://i.muztak.cn/images/yellow-river.jpg',
                        'http://i.muztak.cn/images/yellow-river.jpg',
                        'http://i.muztak.cn/images/yellow-river.jpg',
                        'http://i.muztak.cn/images/yellow-river.jpg',
                    ],
                },
                alltext: {
                    text: "  今天“<b>节日活动拼团</b>”的,可以过来看看看。<p>Расцветали яблони и груши, Поплыли туманы над рекой. </p><p>Выходила на берег катюша, На высокий берег на крутой. Выходила на берег катюша, На высокий берег на крутой. Выходила на берег катюша, На высокий берег на крутой. Выходила на берег катюша, На высокий берег на крутой. </p>"
                },
                bars: [
                    {
                        list:[
                            [
                                { type: "tags", list: ['同城', '圣诞节'], },
                            ],
                            [
                                { type: "bit", icon_code: "M", text: 75, unit: "评", },
                                { type: "bit", icon_code: "L", text: 284, unit: "赞", },
                            ]
                        ]
                    },
                    {
                        list:[
                            [
                            ],
                            [
                                { type: "button", text: '加微信', color: 'green', emit: 'call'},
                            ]
                        ]
                    },
                ],


                description: "今天节日活动拼团的,可以过来看看看。Сегодня хороший день.",
                introduce: "今天节日活动拼团的,可以过来看看看。Расцветали яблони и груши, Поплыли туманы над рекой. Выходила на берег катюша, На высокий берег на крутой.",
            },
        })
    }
</script>

Muz-Item Attributes

参数说明类型可选值默认值
classes自定义类名string
styles自定义样式object
root-url根域名。小程序/APP 需要添加域名string
item条数据配置object
raw-item原始数据object

Option of Item

注意:文本统一键名 text!!!,链接统一键名 url!!!

参数说明类型可选值默认值
title=== 标题区配置 ===object
title.text原:title.title大标题string
title.hot_tip标题热点提示(右侧红条)string"热门"
title.styles自定义样式object{color: red}
description=== 描述文字 ===string
introduce没有呢=== 介绍文字 ===string
summary=== 摘要配置 === object
summary.text摘要文字string
description=== 描述配置 === object
description.text描述文字string
alltext=== 全文区配置 === object
alltext.text全部文字string
lead=== 领头区配置 ===object
lead.cover.url封面地址(矩形)string
lead.cover.hot_tip封面热点提示(右上三角)string"棒"
lead.cover.aspect封面外形stringsquare, pinkierectangle
lead.avatar.url作者头像(中圆)string
lead.avatar.aspect尺寸样式stringlarge, medium, small, minibig
lead.bars....横条,见 barsarray
bars=== 横条区配置 ===详见:Option of Barsarray
cover=== 封面配置 ===object
cover.url封面地址string
cover.text封面文字string
cover.aspect封面外形stringsquarerectangle
cover.emit封面信号string
video=== 视频区配置 ===object
video.text原:video.title视频标题string
video.cover视频封面string
video.url视频地址。支持 mp4,avistring
video.danmuku视频弹幕。只是个想法,还没实现……string{text: "红色走一波", timestamp: 74848},
swiper=== 轮播区配置 ===object
swiper.emit轮播图信号string
swiper.autoplay轮播图自动播放booleantruefalse
swiper.mode轮播图图片模式stringaspectFillaspectFit, scaleToFill 等 14 种
swiper.styles轮播图样式object{color: 'red'}
swiper.list轮播图列表详见:Option of Swiperarray
isPreview是否支持预览booleantruefalse
sudoku=== 九图区配置 ===object
swiper.list图片地址数组array例:'/images/1.jpg', ...
schrodinger=== 薛定谔图配置 ===object
schrodinger.list图片列表array
kodak=== 柯达胶卷图配置 ===object
kodak.list图片地址数组array例:'/images/1.jpg', ...
emit=== 信号配置 ===object, string
emit.emit自定义信号名string
emit.url支持:muz-area-list信号触发后的跳转地址。注意:需配合 muz-area-list 组件使用,原因是考虑到 muz-item 组件的闭合性原则,所以只在更高级的组件中使用“模版字符串”等高级功能。string
config.cancelBubble取消冒泡事件即取消"item"事件booleanfalsetrue
=== 自定义键配置 ===string
.slot自定义槽名string

Option of Bars in Item

参数说明类型可选值默认值
type数据类型stringbit, title, author, rank, summary, descriptiontags, five-star, time, price, buttonbit
text显示文本string, number
text评星星级适用:five-starnumber0.0~5.0 (step: 0.5)
hot_tip热点提示适用:titlestring"棒"
icon图标地址适用:author, rank, price, bit, timestring
icon_code图标字体代码适用:author, rank, price, bitstring"r"卢布, "M"评论, "L"爱心
label标签(前辍)适用:title, bit, pricestring
unit单位(后辍)适用:price, bitstring"卢布"
zero价格为空或零时的占位符适用:pricestring
emit信号名,事件适用:title, bit, author, 暂不支持:price, button, tagsstring
list多个标签适用:tagsstringarrayarray"同城 ;圣诞节" 或'同城', '圣诞节'{tag: '同城', color: 'red'}
split分割符适用:tagsstring";"
mode模式。设定 text 值是时间戳或文本适用:timestringtimestampdate
format格式化。适用:timestringyyyy-mm-dd HH:ii:ss.fffyyyy-mm-dd HH:ii:ss
color按钮适用:title, bit, tags, buttonstringindigo, red, orange, green, blue, purple
labelColor按钮适用:title, pricestringindigo, red, orange, green, blue, purple
list横条区一行数据。1 个元素左对齐,2 个元素两端对齐,3+个元素两头分散对齐,选项配置与 Bars 相同。arrayarray<array>
desensitize大于 0,从字符首位向后替换几位,小于 0,从字符末尾向前替换几位等于 0,不做处理适用:authornumber0
desensitizeHolder替换字符,配合 desensitize 使用适用:authorstring"*"

Option of Swiper's List in Item

参数说明类型可选值默认值
url轮播图地址string
text原:title轮播图文本string

Option of Schrodinger's List in Item

参数说明类型可选值默认值
image图片地址string
burn是否阅后即焚booleantruefalse
burned是否已焚毁booleantruefalse
auth是否授权查看booleantruefalse
authed是否已授权booleantruefalse
text图上文字string
icon价格前的图标string
price图片价格number
unit价格后的单位string

Event

事件名称说明回调参数
item点击条数据任一位置触发item - 条数据配置(结构配置)
emit自定义事件触发Todo 仅实现了根信号,各元素待开发{emit, config, node}- 信号名, 信号配置, 触发节点

List-Area 列表区渲染

该组件基于 muz-item 进行列表区域渲染,自动请求相关数据。

基本用法

<template>
    <muz-list-area :config="it.config" :request="request" :options-request="optionsRequest" :page="request.page" :limit="request.limit" :item-template="itemTemplate" :item-function="itemFunction" />
</template>

<script>
export default {
    components: {
        MuzItem: () => 'muz-item', // 注:微信小程序不支持此组件懒加载方式
    },
    data: () => ({
        config: {},
        request: {
            url: '/api/news_list',
            rootUrl: 'http://xx.cn',
            method: 'GET',
            param: {},
            headers: {},
            page: 1,
            limit: 10,
            showMore: false,
            nodeStatus: 'err',
            nodeStatusValue: 0,
            nodeData: 'data.list',
        },
    }),
};
</script>

List-Area Attributes

参数说明类型可选值默认值
classes自定义类名string
styles自定义样式object
page当前页数注:哆啦 A 梦需在 request 配置number1
limit每页限制条数注:哆啦 A 梦需在 request 配置number10
config列表区配置object
page-param传入页面参数,用于定制化不同页面过滤结果object
append-list附加列表array
item-template条数据模版。详见:Item 条数据object
item-template-set条数据模版集合。item-template 的集合,常用配置多展示样式object{news: ...}
item-function条数据函数。编历每条数据时调用该函数序列化为 muz-item 配置。functionfunction(item){ return {title: xxx}}
request组件数据请求配置详见:Option of Requestobject, function 待加
options-request多组选项的请求配置详见:Option of Options-Requestarray
item-templates-request条数据模版集请求配置详见:Option of Item-Templates-Requestarray
extend-options-param扩展选项参数object

Option of Config

参数说明类型可选值默认值

| debug

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago