Skip to content

Commit

Permalink
v0.17.4
Browse files Browse the repository at this point in the history
feat: v0.17.4
  • Loading branch information
w3cmark authored Sep 22, 2019
2 parents cbcf015 + b29004a commit 8726606
Show file tree
Hide file tree
Showing 137 changed files with 2,850 additions and 257 deletions.
246 changes: 246 additions & 0 deletions docs/zh-CN/.vuepress/components/block/imagelist/block.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
const fields = {
text: {
label: '文本',
type: 'text'
},
inputnumber: {
type: 'inputnumber',
label: '数字输入'
},
select: {
type: 'select',
label: 'select多选',
props: {
options: {
a: '黄金糕',
b: '双皮奶',
c: '蚵仔煎',
d: '龙须面',
e: '北京烤鸭'
}
}
}
}
export default {
imagelist1: {
type: 'imagelist',
ctx: 'view',
resource: {
api: {
prefix: 'http://rap2api.taobao.org/app/mock/231578/ams/mock/',
list: 'imagelist'
},
fields: {
id: {
type: 'text'
}
}
},
operations: {
id: {
slot: 'searchs',
type: 'field',
label: '文本'
},
search: {
slot: 'searchs',
type: 'button',
props: {
type: 'primary'
},
label: '搜索',
event: 'list:1'
},
rejectedItem: {
type: 'text',
props: {
type: 'danger',
size: 'mini',
},
label: '驳回'
},
rejectedItem1: {
type: 'text',
props: {
size: 'mini',
},
label: '通过(设计)'
},
rejectedItem2: {
type: 'text',
props: {
size: 'mini',
},
label: '通过(协助)'
},
deleteItem: {
type: 'button',
props: {
type: 'text',
size: 'mini',
icon: 'el-icon-delete'
}
},
editItem: {
type: 'icon',
label: '编辑',
icon: 'el-icon-edit'
}
},
pageSize: 10,
props: {
// shadow: 'always', // 阴影效果,可取值:hover(默认)| always | never
// subtitle: 'always' // 子标题出现方式,可取值:hover(默认)| always
// pagination: 'simulate' // 模拟分页
},
events: {
init: '@list',
},
actions: {
rejectedItem() {
alert('点击了驳回');
},
rejectedItem1() {
alert('通过(设计)');
},
clickImageItem(args) {
// 内置的action
console.log(args);
alert('点击图片');
},
editItem() {
alert('点击了编辑');
}
},
options: {
// imageSrc: {
// field: 'image' // 字段名
// },
title: {
field: 'title',
// 'prefix-icon': 'el-icon-search'
'prefix-tag': {
type: 'info', // success | info | warning | danger
label(args) {
return args.status;
}
}
},
subtitle: {
field: 'content'
},
info: {
field: 'info'
}
}
},
imagelist2: {
type: 'imagelist',
ctx: 'view',
resource: {
api: {
prefix: 'http://rap2api.taobao.org/app/mock/231578/ams/mock/',
list: 'imagelist2'
},
fields: {
id: {
type: 'text'
}
}
},
operations: {
id: {
slot: 'searchs',
type: 'field',
label: '文本'
},
search: {
slot: 'searchs',
type: 'button',
props: {
type: 'primary'
},
label: '搜索',
event: 'list:1'
},
rejectedItem: {
type: 'text',
props: {
type: 'danger',
size: 'mini',
},
label: '驳回'
},
rejectedItem1: {
type: 'text',
props: {
size: 'mini',
},
label: '通过(设计)'
},
rejectedItem2: {
type: 'text',
props: {
size: 'mini',
},
label: '通过(协助)'
},
deleteItem: {
type: 'button',
props: {
type: 'text',
size: 'mini',
icon: 'el-icon-delete'
}
},
editItem: {
type: 'icon',
label: '编辑',
icon: 'el-icon-edit'
}
},
pageSize: 10,
props: {
// shadow: 'always', // 阴影效果,可取值:hover(默认)| always | never
subtitle: 'always' // 子标题出现方式,可取值:hover(默认)| always
// pagination: 'simulate' // 模拟分页
},
events: {
init: '@list',
},
actions: {
rejectedItem() {
alert('点击了驳回');
},
rejectedItem1() {
alert('通过(设计)');
},
clickImageItem(args) {
// 内置的action
console.log(args);
alert('点击图片');
},
editItem() {
alert('点击了编辑');
}
},
options: {
title: {
field: 'title',
// 'prefix-icon': 'el-icon-search'
'prefix-tag': {
type: 'info', // success | info | warning | danger
label(args) {
return args.status;
}
}
},
subtitle: {
field: 'content'
},
info: {
field: 'info'
}
}
}
};
40 changes: 40 additions & 0 deletions docs/zh-CN/.vuepress/components/block/imagelist/demo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<el-card shadow="hover" class="demo demo-card">
<ams-block v-if="init" :name="blockName" class="demo-card-preview"/>
<div :class="`demo-card-config ${showConfig ? 'open': ''}`">
<highlight-code lang="javascript">
{{ configCode }}
</highlight-code>
</div>
<div class="demo-card-config-btn" @click="toggleDemoCofig">
<i :class="`el-icon-caret-${showConfig ? 'top': 'bottom'}`"></i>
{{ showConfig ? '隐藏' : '显示'}}配置
<el-link v-if="onlineDemo" :href="onlineDemo" target="_blank" type="success">在线运行</el-link>
</div>
</el-card>
</template>

<script>
import demoMixins from '../../demo/demo-mixin'
import block from './block'
import stringify from '@ams-team/json-stringify'
import beautify from 'js-beautify'
export default {
mixins: [demoMixins],
mounted(){
const stringConfig = stringify(block[this.blockName])
this.configCode = beautify(stringConfig, { indent_size: 2, space_in_empty_paren: true })
// 如果已经注册过则不再注册
if (ams && ams.blocks && ams.blocks[this.blockName]) {
this.init = true;
return;
}
ams.block(this.blockName, block[this.blockName])
this.init = true
}
}
</script>
5 changes: 4 additions & 1 deletion docs/zh-CN/.vuepress/components/block/router/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export default {
{
path: '/list',
name: '列表页',
block: 'listComponent'
block: 'listComponent',
meta: {
icon: 'ams-icon-watcher'
}
}
]
},
Expand Down
Loading

0 comments on commit 8726606

Please sign in to comment.