-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from vipshop/develop
v0.24.0
- Loading branch information
Showing
111 changed files
with
1,047 additions
and
684 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ package-lock.json | |
*.sln | ||
|
||
/dist | ||
/lib | ||
/docs/dist | ||
/packages/*/lib | ||
/material-list.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
export default { | ||
htmlField1: { | ||
ctx: 'view', | ||
type: 'form', | ||
resource: { | ||
fields: { | ||
id: { | ||
type: 'text', | ||
label: '序号' | ||
}, | ||
html: { | ||
type: 'html', | ||
label: '渲染字段', | ||
view(value, field, contxt) { | ||
// 可在view里面进行html拼接 | ||
return value + '<img src="https://vipshop.github.io/ams/index/ams-logo.png" />' | ||
} | ||
} | ||
} | ||
}, | ||
data: { | ||
id: '1204', | ||
html: '<div style="color: red">我是渲染的内容</div>' | ||
} | ||
}, | ||
htmlField2: { | ||
ctx: 'view', | ||
type: 'list', | ||
resource: { | ||
fields: { | ||
id: { | ||
type: 'text', | ||
label: '序号' | ||
}, | ||
html: { | ||
type: 'html', | ||
label: '渲染字段', | ||
view(value, field, context) { | ||
// 可在view里面进行html拼接 | ||
// console.log('context-上下文', context); | ||
return '<span style="color:red;">'+ value+'</span><img src="https://vipshop.github.io/ams/index/ams-logo.png" />' | ||
|
||
} | ||
} | ||
} | ||
}, | ||
data: { | ||
list: [ | ||
{ | ||
id: 1, | ||
html: '1' | ||
}, | ||
{ | ||
id: 2, | ||
html: '2' | ||
}, | ||
{ | ||
id: 3, | ||
html: '3' | ||
}, | ||
] | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.