Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编辑器 自定义组件很容易 【渲染发生错误】 #8375

Closed
lhtuling opened this issue Oct 12, 2023 · 2 comments
Closed

编辑器 自定义组件很容易 【渲染发生错误】 #8375

lhtuling opened this issue Oct 12, 2023 · 2 comments
Assignees

Comments

@lhtuling
Copy link

截图或视频:

image

如何复现(请务必完整填写下面内容):

html代码
(并且自定义代码里面Html内容vue语法报错,粘贴进去会自动格式化导致自动多了很多空格 html代码直接就废了)

<el-button @click="visible = true" >Button</el-button>
<el-dialog :visible.sync="visible" title="Hello world">
  <p>Try Element</p>
</el-dialog>

onMount代码

const app = new Vue({
  el: dom,
  data: {
    visible:false
  }
})
@lhtuling
Copy link
Author

packages\amis\src\renderers\Custom.tsx
127行修改代码 可以实现屏蔽错误
弊端是:编辑器内不会响应对应的功能代码! 编辑器内显示可能不准确
但是最重要的是这样的话可以选择这个控件进行编写代码了
不然直接一段红色文字提示的话,编辑器内针对这个控件啥都干不了了!

image

@wibetter wibetter self-assigned this Nov 24, 2023
@wibetter
Copy link
Collaborator

@lhtuling custom 组件中使用 vue2 语法,请先引入vue.js(umd 或 global 模块,比如:https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants