Socket
Book a DemoInstallSign in
Socket

amis-layout

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amis-layout

爱速搭框架渲染器+设计器

0.1.0-beta.11
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

amis-layout

爱速搭框架渲染器+设计器

安装

npm i amis-layout

使用

基础用法

import {render as renderAmis} from 'amis';
import 'amis-layout';
import 'amis-layout/dist/style.css';

const App = (props) => {
    return (
        {
            // 渲染
            renderAmis({
                type: 'app-layout',
                preset: '3',
                header: [
                    {
                        type: 'tpl',
                        tpl: '我的应用'
                    }
                ],
                page: [
                    {
                        type: 'page',
                        body: [
                            {
                                type: 'tpl',
                                tpl: '我的页面'
                            }
                        ]
                    }
                ]
            })
        }
    )
}

挂载外部脚本

import {render as renderAmis} from 'amis';
import 'amis-layout';
import 'amis-layout/dist/style.css';

const App = (props) => {
    return (
        {
            // 渲染
            renderAmis({
                type: 'app-layout',
                preset: '3',
                supportExtraScript: true,
                extraCss: [
                    {
                        url: 'https://127.0.0.1:5500/main.css'
                    },
                    {
                        url: 'https://127.0.0.1:5500/iconfont.css'
                    }
                ],
                extraJs: [
                    {
                        url: 'https://127.0.0.1:5500/bundle.js',
                        callback: async function () {
                            // 派发渲染器事件
                            this.dispatchEvent('JS_LOAD_FINISH', {data: 'xxx'});
                        }
                    }
                ],
                page: [
                    {
                        type: 'page',
                        body: [
                            {
                                type: 'tpl',
                                tpl: '我的页面'
                            }
                        ]
                    }
                ]
            })
        }
    )
}

属性表

参考 types.d.ts

FAQs

Package last updated on 15 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.