aisuda / amis-widget Goto Github PK
View Code? Open in Web Editor NEWamis组件注册器(支持react、vue2.0、vue3.0和jQuery技术栈),主要用于注册amis渲染器、amis-editor插件。
amis组件注册器(支持react、vue2.0、vue3.0和jQuery技术栈),主要用于注册amis渲染器、amis-editor插件。
使用amis 搭建出来的页面 如何导出呢? 我看编辑自带的导出按钮置灰了。。
Uncaught (in promise) TypeError: Class constructor MyReactSelect cannot be invoked without 'new'
rt
@wibetter 请问下面的报错怎么配置,"amis-widget": "^1.3.5",
感觉想自己扩展editor, 例子有点少.
amis真的方便. 很适合我这种不咋会前端的人. 非常谢谢你们团队
文档中提到 有个 vue3-amis-widget
请问这个仓库开源了吗?
目前支持的技术栈:jQuery、vue2、react,vue3.0技术栈在vue3-amis-widget中支持
@wibetter
https://github.com/aisuda/amis-widget/tree/master/src/frameworkFactory/vueFactory.tsx
这个文件中
render() {
return <div ref={this.domRef}></div>;
}
返回了div 样式没添上
有时候我只是需要自定义一些小组件,可配置,并不是一定要展示到自定义组件中,有参数可以配置吗
自定义vue组件是没啥问题,但是editor不是开源的,在vue组件中body嵌套怎么去实现呢,使用slot,children?
嵌套结构又如何同步到左侧目录结构中呢?
@demo中react自定义组件自己嵌套自己也存在问题, 会报''类型错误,无法渲染"
info-card.jsx 中添加了渲染子组件的代码
scaffold = {
type: 'react-info-card',
label: 'react-info-card',
name: 'react-info-card',
body:[{
type: 'wrapper',
body:[
{
type: 'react-info-card',
label: 'react-info-card',
name: 'react-info-card',
body:[]
}
]
}]
};
我有一个vue组件,要如何处理才能实现把方法/动作暴露给其它amis组件使用,其它amis组件可以使用Action来触发,比如下面的例子,我的组件名是tabs-vue,需要使用amis的按纽点击后选中某个选项卡.
{ "type": "page", "body": [ { "type": "button", "label": "选中选项卡2", "level": "primary", "className": "mr-3 mb-3", "onEvent": { "click": { "actions": [ { "actionType": "changeActiveKey", "componentId": "tabs-change-receiver", "args": { "activeKey": 2 } } ] } } }, { "id": "tabs-change-receiver", "type": "tabs-vue", "mode": "line", "tabs": [ { "title": "选项卡1", "body": "选项卡内容1" }, { "title": "选项卡2", "body": "选项卡内容2" }, { "title": "选项卡3", "body": "选项卡内容3" } ] } ] }
文档里说的如下,但vue的自定义如何处理,请指教。
`
需求场景主要是想要自定义组件的内部事件暴露出去,能够通过对事件的监听来执行所需动作,并希望自定义组件自身的动作能够被其他组件调用。接入方法是通过props.dispatchEvent派发自身的各种事件,使其具备更灵活的交互设计能力;通过实现doAction方法实现其他组件对其专属动作的调用,需要注意的是,此处依赖内部的 Scoped Context来实现自身的注册,可以参考 组件间通信。
`
你好!首先感谢在百忙中恢复我的issue,最近在调研低代码,看到了amis这个产品,感觉很适合我们,现在有几个疑问点,麻烦抽空回复下:(我们的需求其实都用不上这么多组件,只是需要托拉拽针对echarts设置及回显)
1.阅读了下源码amis底层是基于react+ts编写的,我们的项目是vue3+js,直接引入进来的话这种模式是否有文档?还是说我要将ts语法改写为js?
2.amis-widget这个项目clone后是否可以直接运行?(我clone后安装依赖跑起来控制台报错了,所以这个是不是只是纯源码,外部使用直接安装依赖即可)
再次感谢!
state中的 amisEnv,配置为{
enableAMISDebug:true,
requestAdaptor:function(api){
alert(api)
api.headers = api.headers || {};
api.headers["Authorization"]=Cookies.get("Data-Token");
console.log(111,api);
return {...api};
},
没有效果,没有拦截到请求
自定义 vue 组件 使用onEvent 触发actions 不生效
版本 amis sdk @ 2.7.2
json:
{ "type": "form", "title": "表单", "body": [ { "label": "文本框", "type": "input-text", "name": "text" }, { "type": "datamodel-select", "label": "模型下拉-数据", "name": "datamodel-select", "id": "u:65a6bf9c0d15", "option": { "datatype": "xxx", "apiCode": "xxxxxx", "label": "linkName", "value": "linkCode", "multiple": false, "filterCondition": [ ], "valueBackFill": [ { "field": "pkId", "target": "text" } ], "fetchUrl": "xxxx", "fetchMethod": "post" }, "onEvent": { "change": { // 监听点击事件 "actions": [ // 执行的动作列表 { "actionType": "toast", // 执行toast提示动作 "args": { // 动作参数 "msgType": "info", "msg": "派发点击事件" } } ] }, "onChange": { // 监听点击事件 "actions": [ { "script": "alert(1)", "actionType": "custom" }, { "actionType": "custom", "script": "alert(0)" }, // 执行的动作列表 { "actionType": "toast", // 执行toast提示动作 "args": { // 动作参数 "msgType": "info", "msg": "派发点击事件" } } ] } } } ], "id": "u:fbc6d0fec7b3", "debug": true }
问题:
onChange 触发了里面的值也设置进form了,但是actions 没触发,也不报错
怎么才能事件触发amis 的actions
npm-custom这个前缀能自定义吗,注册的时候传进来使用
文档里没写这块内容,很容易造成混淆,
使用时最外层不需要前缀,内部却需要也会混淆,希望能保持一致
需要重新发版的有:
amis-widget;
一系列自定义组件模板。
@wibetter undefined 会导致报错, 我在rest里做了props合并,vue自定义组件可能会出现不传props的情况
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.