留言板

电脑留言板 手机留言板 微信留言板 多模板 自适应
我们提供企业留言板、留言信箱程序定制等服务
留言板留言板V7.22
免费无限制开源多样式自适应手机版
立即免费下载
更新于 09月30日
赞助打赏深山
让免费服务走的更远

百度小程序开发第一坑tcomponent自定义组件命名坑Compile san component failed. . [SAN ERROR] ROOT>swan-custom-component>view>千万不要用下划线作为自定义组件名

在给组件命名的时候我们大多数的时候命名字母全小写且包含一个连字符,但是有的时候我们也是用单词首字母大写的方式实现的组件命名
如果当我们需要将组件渲染到dom上的时候强烈建议使用全部字母小写且有连接符连接的命名
在html中是大小写不敏感的,使用全小写且连接符连接会帮助我们与当前或者未来的元素冲突
百度自定义组件名不能用下划线


正确示例

"navigationBarTitleText": "智能小程序示例",
"usingComponents": {
"qwbmlist": "/components/searchInput/qwbmlist",
"qwbm-list": "/components/searchList/qwbmlist",
"qwbm_list": "/components/searchList/qwbmlist", //这行就是有问题的,因为用一下划线
}
注意:组件的文件名可以用驼峰命名,但不能用中划线
注意:组件名只能是全小写加中划线,不能用驼峰命名和下划线

index 页面引入
<qwbmlist></qwbmlist>
<qwbm-list></qwbm-list>
<qwbm_list></qwbm_list>    //这行就是有问题的,因为用一下划线


百度小程序开发第一坑tcomponent自定义组件命名坑Compile san component failed. . [SAN ERROR] ROOT swan-custom-component view 千万不要用下划线作为自定义组件名


Compile san component failed.
[SAN ERROR] ROOT>swan-custom-component>view>qwbm's close tag has attributes
Error: Compile san component failed.
[SAN ERROR] ROOT>swan-custom-component>view>qwbm's close tag has attributes
at X (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:49332)
at Object.Ye [as parseComponentTemplate] (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:72922)
at V (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:382573)
at B (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:382868)
at U (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:382979)
at p (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:830845)
at file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:831663
at a.getComponentType (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:831922)
at ke (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:60743)
at a.<anonymous> (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:80346)
at a.attach (D:\Program Files\swan-ide-gui\resources\app\build-3.33.1\app.asar\node_modules\@ecomfe\san-devhook\dist\san_devhook.js:2019:27)
at e.value (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:718106)
at e.value (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:715675)
at file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:712413
at file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:341978
at Array.forEach (<anonymous>)
ext msg: {}
(anonymous) @ D:\Program Files\swan-ide-gui\resources\app\build-3.33.1\app.asar\dist\extensions\simulator\src\webview\preloads\master\events.js:1
(anonymous) @ D:\Program Files\swan-ide-gui\resources\app\build-3.33.1\app.asar\dist\src\services\event\renderer\event-map.js:1
emit @ events.js:203
onMessage @ electron/js2c/renderer_init.js:2422
D:\Program Files\swan-ide-gui\resources\app\build-3.33.1\app.asar\dist\extensions\simulator\src\webview\preloads\master\events.js:1

error from page:

D:\Program Files\swan-ide-gui\resources\app\build-3.33.1\app.asar\dist\extensions\simulator\src\webview\preloads\master\events.js:1 Slave attached error in _transitPageAttach function.
Cannot read property 'tagName' of undefined
TypeError: Slave attached error in _transitPageAttach function.
Cannot read property 'tagName' of undefined
at U (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:383202)
at p (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:830845)
at file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:831663
at a.getComponentType (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:831922)
at ke (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:60743)
at a.<anonymous> (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:80346)
at a.attach (D:\Program Files\swan-ide-gui\resources\app\build-3.33.1\app.asar\node_modules\@ecomfe\san-devhook\dist\san_devhook.js:2019:27)
at e.value (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:718106)
at e.value (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:715675)
at file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:712413
at file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:341978
at Array.forEach (<anonymous>)
at HTMLDocument.<anonymous> (file:///C:/Users/Administrator/AppData/Roaming/%E7%99%BE%E5%BA%A6%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7/cli/vendor/swan-core/3.300.10/slaves/index.js:1:341958)
at D:\Program Files\swan-ide-gui\resources\app\build-3.33.1\app.asar\dist\extensions\simulator-swan-api\src\webview\utils\message.js:1:279
at D:\Program Files\swan-ide-gui\resources\app\build-3.33.1\app.asar\dist\extensions\simulator-swan-api\src\webview\slave\index.js:1:1111
at EventEmitter.<anonymous> (D:\Program Files\swan-ide-gui\resources\app\build-3.33.1\app.asar\dist\src\services\event\renderer\event-map.js:1:1116)
ext msg: {"isWhiteScreen":true}
前一页:暂时没有数据
扫描查看手机留言板效果
留言板演示下载留言板程序
点击在线咨询
手机 13961347334
Q Q 565449214
邮箱 565449214@qq.com