@cdlab996/element-plus-lowcode-materials
v0.0.1
Published
<div align="center">
Downloads
22
Readme
Element Plus(2.6.3) Materials
Component material complete list
- [x] Button
- [x] Affix
Usage Example
pnpm
pnpm add @cdlab996/element-plus-lowcode-materials
Import the package and initialize the editor:
import { injectAssets } from '@alilc/lowcode-plugin-inject'
import { IPublicModelPluginContext } from '@alilc/lowcode-types'
import assets from '@cdlab996/element-plus-lowcode-materials/dist/assets.json'
const editorInit = (ctx: IPublicModelPluginContext) => {
return {
name: 'editor-init',
async init() {
const { material, project } = ctx
const loadedAssets = await injectAssets(assets)
material.setAssets(loadedAssets)
// ...
},
}
}
editorInit.pluginName = 'editorInit'
export default editorInit
CDN
import { injectAssets } from '@alilc/lowcode-plugin-inject'
import { IPublicModelPluginContext } from '@alilc/lowcode-types'
const editorInit = (ctx: IPublicModelPluginContext) => {
return {
name: 'editor-init',
async init() {
const { material, project } = ctx
const loadedAssets = await injectAssets('https://unpkg.com/@cdlab996/element-plus-lowcode-materials/dist/assets.json')
material.setAssets(loadedAssets)
// ...
},
}
}
editorInit.pluginName = 'editorInit'
export default editorInit
assets.json
Here is an example of the assets.json
file:
{
"version": "0.0.1",
"packages": [
{
"package": "@cdlab996/element-plus-lowcode-materials",
"version": "0.0.1",
"library": "Cdlab996ElementPlusLowcodeMaterials",
"urls": [
"https://unpkg.com/@cdlab996/element-plus-lowcode-materials/dist/index.css",
"https://unpkg.com/@cdlab996/element-plus-lowcode-materials/dist/index.js"
]
}
],
"components": [
{
"exportName": "Cdlab996ElementPlusLowcodeMaterialsMeta",
"url": "https://unpkg.com/@cdlab996/element-plus-lowcode-materials/dist/meta.js",
"package": {
"npm": "@cdlab996/element-plus-lowcode-materials"
}
}
],
"sort": {
"groupList": [],
"categoryList": []
}
}