# 插件使用步骤

步骤如下

1.添加插件目录及资源

1)如制作一个cap4表单插件,则对应目录为

/seeyon/common/capextend/cap4/form/utils (多端应用及白名单插件目录详见2-4说明)

在该目录下添加pluginA(插件名)文件夹

2)在pluginA中添加脚本index.js和index.css

2.需求对应脚本实现

如需求为表单加载完成后请求后台某自动处理任务,index.js增加实现代码:

//客开脚本初始化
//do something
function autoTaskRequest() {
    $.ajax({
        url: "seeyon/autoTaskBusiness/customTask2",  
        type: "post",
        data: {param: 0},
        success: function(){}
    }); 
}
csdk.event.on('formRendered', function (data) {
    autoTaskRequest();
});

3.需求对应样式实现

如index.css中实现鼠标悬浮按钮上倾斜效果:

/*基础样式*/
.custom-button {
    color: #fff;
}
/*悬浮样式*/
.custom-button:hover {
    color: blue;
    -webkit-transform: rotate(5deg);
    transform: rotate(5deg);
}
编撰人:yinyanting

快速跳转