Commit e1d86260 by LinChengbiao

testreadme

parent 67b3c891
......@@ -19,27 +19,29 @@
* **新增页面**
* `src/pages/temp.wpy` 文件为页面模板文件,新建页面直接复制这个然后修改就可以了。(一般情况下,改成如下形式就可以自由添加内容了)
``
<template>
<view class="{文件名}Wpy">
{文件名}
</view>
</template>
<script>
import wepy from 'wepy'
export default class {文件名首字母大写} extends wepy.page {
onLoad () {
console.log('{文件名}')
}
}
</script>
<style lang="less" scoped>
.{文件名}Wpy{}
</style>
``
```javascript
<template>
<view class="{文件名}Wpy">
{文件名}
</view>
</template>
<script>
import wepy from 'wepy'
export default class {文件名首字母大写} extends wepy.page {
onLoad () {
console.log('{文件名}')
}
}
</script>
<style lang="less" scoped>
.{文件名}Wpy{}
</style>
```
* 新增的页面必须在 `src/app.wpy` 中配置路径,否则会报错。
* 需要注意 `页面``组件` 的声明方式有所不同:
* 页面声明 `export default class PageName extends wepy.page`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment