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

✨Q&A:常见问题答疑-第二弹 #366

Open
wenmine opened this issue Apr 1, 2024 · 7 comments
Open

✨Q&A:常见问题答疑-第二弹 #366

wenmine opened this issue Apr 1, 2024 · 7 comments

Comments

@wenmine
Copy link
Collaborator

wenmine commented Apr 1, 2024

问题一: 本地执行pnpm dev启动,页面一直loading,进不去

答:
使用开发者工具看一下控制台是否产生报错,若报错如下:
GET https://npm.onmicrosoft.cn/@opentiny/vue-theme-3.11/index.css net::ERR ABORTED 403 (URLGolbalBlocked)

Access to script at "https://npm.onmicrosoft.cn/vue@3/dist/vue.runtime.esm-browser.js' from origin "http://127.0.0.1:888/ 127.0.0.1/:1g’ has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

GET https://npm.onmicrosoft.cn/vue@3/dist/vue.runtime.esm-browser.js net: :ERR_FAILED

解决方案

当前使用的cdn地址为:"npm.onmicrosoft.cn",这个地址用户的电脑可能访问不了,导致无法拿到我们依赖的组件库等内容,可尝试将npm.onmicrosoft.cn替换为unpkg.com,替换文件和位置如下:

packages/design-core/.env.development

image

packages/design-core/.env.prod

image

packages/blockToWebComponentTemplate/vite.config.js

image

在tiny-engine项目中,找到以上文件,把对应的字符串npm.onmicrosoft.cn替换为unpkg.com,替换后保存重新启动项目

问题二:本地启动没有问题,打包好之后部署到环境上,报错如下(或类似):

1711961744377

解决方案

当前使用的cdn地址为:"npm.onmicrosoft.cn",这个地址用户的电脑可能访问不了,导致无法拿到我们依赖的组件库等内容,可尝试将npm.onmicrosoft.cn替换为unpkg.com,替换文件和位置如下:

packages/design-core/.env.development

image

packages/design-core/.env.prod

image

packages/blockToWebComponentTemplate/vite.config.js

image

在tiny-engine项目中,找到以上文件,把对应的字符串npm.onmicrosoft.cn替换为unpkg.com,替换后保存重新打包部署。

问题三:本地执行打包命令后,生成的产物在哪个文件夹?

答: tiny-engine/packages/design-core/dist/

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: ✨Q&A: Frequently Asked Questions-Part 2

@wenmine wenmine pinned this issue Apr 1, 2024
@wenmine
Copy link
Collaborator Author

wenmine commented Apr 11, 2024

问题四:本地使用mockServer时,可以正常出码,但是使用本地连接服务端时,点击出码按钮会报错:不支持的浏览器。
7461fa39511bd124741a4586e824626 #405

A:当前下载文件的api限制只能用https与本地的安全协议(localhost),若需要支持http请求,则需自行开发在不支持https的场景下,下载为zip压缩包的功能

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Question 4: When using mockServer locally, the code can be output normally. However, when using the local connection server, clicking the code output button will report an error: Unsupported browser.

@wenmine
Copy link
Collaborator Author

wenmine commented May 9, 2024

本地启动时报错:PageSetting.vue:69 Uncaught ReferenceError: ref is not defined
image

解决方案:更新develop最新代码,报错原因是:由于当前我们并没有锁定间接依赖的版本,所以在我们重新执行npm install时,代码里用的babel里一套间接依赖最近发了新包,这个新包与老的plugin-vue-jsx不兼容,相当于你的node_modules里拥有了新的babel,但是用的是老的vuejsx。所以需要升级vue-jsx。

具体解决的pr在 #347

@wenmine
Copy link
Collaborator Author

wenmine commented Sep 1, 2024

问题:保存源码到本地,为什么会变成下载zip

因为保存源码到本地,使用了 Window: showDirectoryPicker()和Window: showOpenFilePicker() 这两个API,当前API浏览器兼容性不足,只支持以下浏览器,并且也不允许使用在http协议中,以及内嵌在iframe中。
image

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Question: When saving the source code locally, why does it become a download zip
answer
Because the source code is saved locally, the two APIs Window: showDirectoryPicker() and Window: showOpenFilePicker() are used , the current API browser compatibility is insufficient, only supports the following browsers, and is not allowed to be used in the http protocol or embedded in iframes.
image

@wenmine
Copy link
Collaborator Author

wenmine commented Sep 2, 2024

问题:如何在TinyEngine绑定ref

使用状态管理和变量绑定,将当前ref绑定到state变量中,具体绑定方式请查看手册使用状态管理和变量绑定

问题:物料组件配置好,会带上小尾巴,如何去掉
image


新版本特性:
如果配置了是容器类型,而且子节点为空,那么会默认插入placeholder 辅助拖拽内容拖入。
如果不需要往里面拖入内容,或者非容器类型,需要配置:
{
configure: {
// 配置为 false就不会在 children为空的时候插入 placehokder了
isContainer: false
}
}

问题:服务器部署之后需要使用https访问吗?

需要,具体配置可以看
image

问题: 请求canvas时,想直接请求canvas.html,不需要路径转换,如何处理?

将本文件里的/canvas?tenant=${tenant}改成canvas.html
image

问题:对于官方提供的element-plus表格组件,右侧属性column绑定变量没有在画布中呈现
ff5fa0d6a3ce051443ded4c0bdc33f6a_
答:记做遗留问题,待解决

布局里绝对定位相关问题,可检查一下此pr #751

问题:页面启动时报错:
8ba449796c0416cc361105db23cf5310_

答:3.14下的tinyvue应该要搭配 vue3.4.23

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

No branches or pull requests

2 participants