微信小程序 Page "pages/Index/Index" has not been registered yet.问题解决

在做小程序中,偶尔会遇到这种错误:

Page "pages/Index/Index" has not been registered yet.

出现错误的位置如下图,在.js文件中的Page()上面的代码有误,导致js代码不能正常执行,就会导致wxml页面空白出现上面提示。
js页Page上引用外部js文件

这是大多数是我们自己偷懒,从其他页面复制粘贴,而js外部引用路径错误造成,将路径改正确就可以了。

微信小程序.wxml页面与.js文件是密切相关的,wxml页面的显示又与js文件的Page()密不可分,所以Page()前面的代码出错,导致Page()未执行,那肯定会抛页面未注册的提示,并且wxml页面也呈空白没有任何显示咯。

记录一下这个问题,不然每次遇到还是有点懵。

可能还会有其他情况下会出现,请在下面留言补充。

如果觉得有用,能点个赞再走么,谢谢!!!

  • 26
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 13
    评论
myBase Desktop 6.3.3 12/1/2013 任意注册码注册,完美破解~ IE 插件 webcollect 1.9 最新版 已破解 ,请另行下载。 更新说明: Version 6.3.3 Fixed: a bug in some cases it didn't update index data for all info items but only for the last root item/branch and in result the 'Advanced search' facility may run into glitch. Version 6.3.2 Added: the 'Hide on close' option that redefines the action of the main window's Close (X) button, it simply minimizes the main window when pressing the (X) button; This option works along with the 'Minimize to tray' option. Improved: the SSG-5 based .nyf database supports UTF-8 for more data structures, including item titles, notes, attachment filenames and database file names. Minor changes. Version 6.3.1 Improved: in order for ePub to work with Sony reader, the ePub maker strips font-family and font-size away from within the generated HTML content. Fixed: a bug in the backup process which may fail to create backup for those .nyf file names containing non-ASCII characters. Fixed: it may fail to export content to a new .nyf file with a name containing non-ASCII characters. Minor changes. Version 6.3.0 Added: a new plugin [Share - Export CHM project ...], which exports content and generate CHM project files, so you can compile the project files to CHM documentation by using the Microsoft HTML Help Workshop. Added: a new plugin [File - Maintenance - Replicate database ...], which replicates content from the currently working database to another database file which is initialized with a specified storage version. Added: the Load-on-Access feature, which allows to delay-load info items and content. This way, databases can open up instantly within one or just a few seconds, unless you need to automatically create backups or simultaneously load a large number of info items when opening the database. Added: the 64-bit structured storage engine (SSG-5), which enables you to create large database files (>2GiB), and encrypt data on the fly using AES-256 while saving information into your database. Added: a dialog box for creating new databases, whereby you can choose the storage library from SSG-5 or SSG-3, compression level from 0 to 9, and set a password for database encryption or authentication as per your choice of the storage library. Added: a command line (or shell command) tool for manipulating .nyf databases by Batch shell scripts. For details please refer to Wjjsoft Structured Storage Library (SSG-5). Added: a progress indicator to report import/export specific operations during dragging-and-dropping a large number of info items across different databases. Added: The viewer program is now shiped within the desktop package, so you don't need to manually download and copy it to the setup folder for creating the standalone .exe databases, and the 'Make exe database' dialog box has been simplified accordingly. Added: a new language file (rus.ini) for Russian. Thanks to Churakov Anton for contributing. Added: a new look of common controls on the user interface by enabling Windows 7 style. Added: a collection of 16x16 bitmaps that can be loaded as custom icons. Added: the 'sort by name' list style for the custom icons dialog box. Fixed: a bug in the 'Search with RegExp' plugin, it didn't search attachment file names. Fixed: a bug in calling the MFC/CFile member functions, it may fail to load large database file (>2GiB). Fixed: a bug in the 'Export Html Tree' plugin, which might cause filename conflicts resulting in files getting overwritten while exporting. Fixed: a bug in the query results that may list out those non-existent entries ever moved or deleted. Fixed: a bug in the 'move item left' facility which may cause the program to crash. Fixed: a bug in the ePub maker that didn't declare charset and language code for xHTML content. Fixed: a bug in the conversion of RTF table to HTML, that applies to several plugins: Export HTML, ePub, CHM and HTML Tree etc. Minor changes. Version 6.2.0 Added: a new plugin [Share - Export ePub digital book ...], which helps export contents in the current branch and generate .epub digital books. Fixed: a bug in the HtmlTree maker which caused the exported text not to wrap correctly; Minor changes. Version 6.1.3 Fixed: a problem with searching RTF notes/documents (a bug in the previous revision 6.1.2). It's recommended to clear and rebuild indexes for relevant databases to consolidate the search facility; Minor changes. Version 6.1.2 Fixed: Pressing the APP key didn't trigger the context menu within the outline tree view; Fixed: Images of saved webpages with filenames having blank spaces didn't show up within the embedded web browser; Fixed: The confirmation dialog box for label deletion didn't work; Fixed: The plain text imported as RTF notes (e.g. import directory tree) weren't indexed correctly; Fixed: A bug in the XML API; Fixed: Import OPML items incompletely; Fixed: Item links not working within the exported HTML tree; Added: Import journal items from a template; Minor changes.
下面是一个完善的2048微信小程序的样式文件(index.wxss)和视图文件(index.wxml)的示例: index.wxss: ```css /* 根容器样式 */ .container { padding: 20rpx; } /* 游戏区域样式 */ .game-area { display: grid; grid-template-columns: repeat(4, 1fr); grid-gap: 10rpx; background-color: #bbada0; padding: 10rpx; } /* 游戏格子样式 */ .grid { width: calc((100% - 50rpx) / 4); height: calc((100% - 50rpx) / 4); background-color: #cdc1b4; border-radius: 4rpx; position: relative; } /* 格子数字样式 */ .number { font-size: 32rpx; font-weight: bold; text-align: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } /* 得分样式 */ .score { margin-top: 20rpx; font-size: 24rpx; } ``` index.wxml: ```html <view class="container"> <view class="game-area"> <!-- 渲染游戏格子 --> <block wx:for="{{grids}}" wx:key="index"> <view class="grid" data-x="{{index}}" wx:for="{{item}}" wx:key="index" bindtap="onGridTap"> <!-- 渲染格子数字 --> <text class="number" wx:if="{{item !== 0}}">{{item}}</text> </view> </block> </view> <view class="score">得分: {{score}}</view> </view> ``` 在样式文件中,我们设置了游戏区域的样式,游戏格子的样式,以及格子数字和得分的样式。 在视图文件中,我们使用了wx:for指令来循环渲染游戏格子。每个格子都绑定了data-x属性来表示该格子的横坐标,同时使用bindtap绑定了onGridTap事件,以便在点击格子时触发相应的逻辑。同时,我们还渲染了得分的文本。 希望以上示例能够帮助您完善2048微信小程序的样式和视图结构。您可以根据自己的需求进行修改和扩展。祝您成功!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

丶Hoo

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值