How to use the @ams-team/ams.block function in @ams-team/ams

To help you get started, we’ve selected a few @ams-team/ams examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vipshop / ams / docs / zh-CN / .vuepress / components / ams-config.vue View on Github external
mounted() {
        console.log('mounted');
        // 如果已经注册过则不再注册

        ams.block('ams-config', {
            type: 'ams-config',
            options: {
                type: this.type,
                name: this.name
            }
        });

        this.init = true;
    }
}
github vipshop / ams / docs / zh-CN / .vuepress / components / utils / convert / convent.vue View on Github external
mounted() {
        // 如果已经注册过则不再注册
        if (ams && ams.blocks && ams.blocks['convent']) {
            this.init = true;
            return;
        }

        ams.block('convent', blockConfig);

        this.init = true
    }
}
github vipshop / ams / packages / block-ams-config / src / field.vue View on Github external
//         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) {
github vipshop / ams / packages / block-ams-config / src / operation.vue View on Github external
//     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) {
github vipshop / ams / examples / router / src / ams-config / form / list-layout.js View on Github external
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: {
                        // 支持多选
github vipshop / ams / docs / doc / .vuepress / components / market / template / template.vue View on Github external
mounted() {
        // 如果已经注册过则不再注册
        if (ams && ams.blocks && ams.blocks['market-template']) {
            this.init = true;
            return;
        }

        ams.block('market-template', block)

        this.init = true
    }
}
github vipshop / ams / examples / router / src / ams-config / cases-block / imagelist2.js View on Github external
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',
github vipshop / ams / examples / router / src / ams-config / cases-field / image.js View on Github external
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的图片',
github vipshop / ams / examples / router / src / ams-config / cases-block / dropdown.js View on Github external
import ams from '@ams-team/ams';

ams.block('dropdown', {
    blocks: {
        'dropdowntext1': {
            type: 'component',
            options: {
                'is': 'h3',
                'text': '普通示例:'
            }
        },
        'dropdown1': {
            type: 'dropdown',
            options: {
                menu: '下拉菜单一',
                menuItems: [
                    '黄金糕',
                    '狮子头',
                    '螺蛳粉',
github vipshop / ams / examples / router / src / ams-config / cases-sence / add-item-action.js View on Github external
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,