Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mounted() {
console.log('mounted');
// 如果已经注册过则不再注册
ams.block('ams-config', {
type: 'ams-config',
options: {
type: this.type,
name: this.name
}
});
this.init = true;
}
}
mounted() {
// 如果已经注册过则不再注册
if (ams && ams.blocks && ams.blocks['convent']) {
this.init = true;
return;
}
ams.block('convent', blockConfig);
this.init = true
}
}
// type: 'button',
// label: key,
// props: {
// type: 'primary',
// plain: true
// },
// event: `select:${key}`
// };
// });
// normalTitle.operations.reset = {
// type: 'button',
// label: '重置'
// };
// previewBlock.blocks.normalTitle = normalTitle;
ams.block('$ams-config-preview', previewBlock);
this.previewCodeReady = true;
},
updatePreview(data) {
// normalTitle.operations[key] = {
// type: 'button',
// label: key,
// props: {
// type: 'primary',
// plain: true
// },
// event: `select:${key}`
// };
// });
// normalTitle.operations.reset = {
// type: 'button',
// label: '重置'
// };
// previewBlock.blocks.normalTitle = normalTitle;
ams.block('$ams-preview-titleBlock', previewTitle);
ams.block('$ams-config-preview', previewBlock);
this.previewCodeReady = true;
},
updatePreview(data) {
import ams from '@ams-team/ams';
ams.block('list-layout', {
blocks: {
firstScreen: {
type: 'component',
style: {
position: 'releative'
},
blocks: {
listOperationView: {
type: 'list',
resource: 'resource',
style: {
width: '100%',
transition: '0.3s'
},
options: {
// 支持多选
mounted() {
// 如果已经注册过则不再注册
if (ams && ams.blocks && ams.blocks['market-template']) {
this.init = true;
return;
}
ams.block('market-template', block)
this.init = true
}
}
import ams from '@ams-team/ams';
ams.block('imagelist2', {
type: 'imagelist',
ctx: 'view',
resource: {
api: {
prefix: 'https://nei.netease.com/api/apimock/b7c10125b452d3142d8375cf634f0b47/ams/mock/',
list: 'imagelist2'
},
fields: {
id: {
type: 'text'
}
}
},
operations: {
id: {
slot: 'searchs',
import ams from '@ams-team/ams';
import { prefix } from '@/utils';
const upload = `${prefix}upload-image`;
const datas = {};
ams.block('image', {
resources: {
image: {
api: {
prefix: prefix,
create: 'create',
contentType: 'json'
},
fields: {
image1: {
label: '默认图片上传',
type: 'image'
},
image2: {
label: '大小限制',
type: 'image',
tip: '只能不超过50kb的图片',
import ams from '@ams-team/ams';
ams.block('dropdown', {
blocks: {
'dropdowntext1': {
type: 'component',
options: {
'is': 'h3',
'text': '普通示例:'
}
},
'dropdown1': {
type: 'dropdown',
options: {
menu: '下拉菜单一',
menuItems: [
'黄金糕',
'狮子头',
'螺蛳粉',
import ams from '@ams-team/ams';
ams.block('add-item-action', {
type: 'list',
resource: 'resource',
events: {
init: '@list',
add: '@addItemAfter @after',
addDialog: '@addItemDialog @after',
edit: '@editItemAfter @after',
editDialog: '@editItemDialog @after',
},
fields: {
testVideo: false,
testAudio: false,
precent: false,
testArrays: false,
testText: false,
testRadioArray: false,