当前位置:网站首页>Introduction to micro build low code zero Foundation (lesson 2)
Introduction to micro build low code zero Foundation (lesson 2)
2022-04-23 01:51:00 【Low code preacher】
We made a small example in the first lesson , Click on the text component , A message pops up

In this section, we continue to introduce the relevant knowledge in low code .
API Application program interface (Application Programming Interfaces), Is a common technical concept in low code , In low code, we have a lot of API have access to . Micro build low code provides two types API Interface , Divided into front end API Back end API.
front end API Including interface interaction interface 、 Tool related interfaces 、 Routing related interface 、 Data source related interfaces 、 Several types of platform related interfaces .
Display the pop-up effect in the way of code call
For example, in the example we introduced in Lesson 1 , Platform method called ,showModal Popup .

In addition to setting directly in the behavior , We can also call through code . You can write a custom method . Find the low code editor in the function menu in the upper left corner

Then under the corresponding page handler Click next to the + Number , Create custom method

Then from the front end of the official document API Find sample code in

Paste into the editor

export default function ({
event, data }) {
app.showModal({
title: ' Tips ',
content: ' This is a modal pop-up window ',
success(res) {
if (res.confirm) {
console.log(' The user clicks OK ');
} else if (res.cancel) {
console.log(' The user clicks cancel ');
}
}
});
}
After the custom method is created successfully, we can set it as a custom method in the behavior

Except that it can be called in low code api Outside , The most common is in expression calls api. For example, format the conversion date
Small example Format date
If a date type field is set in the data source , The time stamp is displayed in the front-end display , A string of numbers . In order to display normally, we need to format the timestamp , Become the date format we want .
Let's create a data source first , There's a title inside 、 Release date two fields , The type of release date is date type

Then add a data list component to the page , Set up the data source , Bind the content inside to the corresponding field

If you bind directly, the field displays a timestamp , A string of numbers , If we want to format the output, we can do it when the variable is bound , Call... Through an expression API To achieve

app.utils.formatDate(new Date(forItems.id8.faburiqi), 'yyyy-mm-dd')
After formatting the binding , You can see that the date can be displayed normally

Server side API The external system needs to integrate micro interface , You can call . Because it's an introductory course , Let's not introduce this for the time being , Small partners in need can study the official documents by themselves : Server side API
summary
Let's talk about the calling front end of the middle note in this code. api Two ways , Then it introduces a small example of formatting dates . Low code learning also needs to be solid , Daily arch , More accumulation , When you do a project in the future, you can catch it .
版权声明
本文为[Low code preacher]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220910435415.html
边栏推荐
- Jerry's CPU performance test [chapter]
- How to initialize "naming and surname" in C language
- 搭建个人主页保姆级教程(二)
- .NET单元测试第一篇:常见.NET单元测试框架有哪些?
- What code needs unit testing?
- 使用单元测试框架编写单元测试的好处?
- [experience tutorial] Alipay balance automatically transferred to the balance of treasure how to set off, cancel Alipay balance automatically transferred to balance treasure?
- Quel est le fichier makefile?
- Is the availability of proxy IP equal to the efficiency of proxy IP?
- Solve the problem when installing MySQL
猜你喜欢

What should I pay attention to when using proxy IP?

BGP服务器在什么业务场景会被用到?

CDR2022首发全新版本性能介绍

领导/老师让填写电子excel表格文档可手机上如何编辑word/excel文件填写excel/word电子文档?

浅析静态代理ip的三大作用。

How to set computer IP?

一些使用代理IP的小技巧。
![[tutorial] how to use GCC](/img/60/c5804fc4da965afaa3cc72c44a11f9.png)
[tutorial] how to use GCC "zero assembly" for white whoring MDK

单片机和4G模块通信总结(EC20)

NR polar code VII - SCL (successful cancellation list coding)
随机推荐
如何设置电脑ip?
Jerry's AI server [chapter]
拨号vps会遇到什么问题?
什么是代理IP池,如何构建?
Under the pressure of sales, domestic mobile phones began to reduce prices, but they haven't put down their final face
如何“优雅”的测量系统性能
客户端项目管理经常面临的挑战
Chapter 6 uses Matplotlib to draw thermodynamic diagram
动态代理ip的测试步骤有哪些?
Echo "new password" |passwd -- stdin user name
Sqlserver data transfer to MySQL
Jerry's CPU performance test [chapter]
Summary of LSF usage
2022.4.22-----leetcode.396
腾讯云接口进行人脸检测 和签名出错问题
Learning methods and career development guide (2022 Edition)
Uncover floating-point operations hidden by the ARM compiler
What business scenarios will the BGP server be used in?
什么时候应该编写单元测试?什么是TDD?
[经验教程]支付宝余额自动转入余额宝怎么设置关闭取消支付宝余额自动转入余额宝?