Skip to content

Commit 882fb59

Browse files
authored
Merge pull request #3 from mpvue/develop
update: 更新文档
2 parents e71cacd + 216f3e1 commit 882fb59

File tree

7 files changed

+46
-5
lines changed

7 files changed

+46
-5
lines changed

docs/build/mpvue-loader.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ vueApp.$mount();
136136
export default {
137137
// 这个字段下的数据会被填充到 app.json / page.json
138138
config: {
139-
pages: ['static/calendar/calendar' '^pages/list/list'], // Will be filled in webpack
139+
pages: ['static/calendar/calendar', '^pages/list/list'], // Will be filled in webpack
140140
window: {
141141
backgroundTextStyle: 'light',
142142
navigationBarBackgroundColor: '#455A73',

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Owl.start({
3535
- 使用 `Vue.js` 命令行工具 vue-cli 快速初始化项目
3636
- H5 代码转换编译成小程序目标代码的能力
3737

38-
其它特性正在等着你去探索。
38+
其它特性正在等着你去探索[详细文档](./mpvue)
3939

4040
### H5 和小程序如何复用代码
4141
先来看一段视频:

docs/mpvue/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ Class 与 Style 绑定的实现方式为使用正则匹配将 `v-bind:class="{ a
146146
```html
147147
<template>
148148
<!-- 支持 -->
149-
<div class="container {{ computedClassStr }}"></div>
149+
<div class="container" :class="computedClassStr"></div>
150150
<div class="container" :class="{active: isActive}"></div>
151151

152152
<!-- 不支持 -->
153-
<div class="container {{ computedClassObject }}"></div>
153+
<div class="container" :class="computedClassObject"></div>
154154
</template>
155155
<script>
156156
export default {

docs/mpvue/quickstart.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,7 @@ $ npm run dev
7070
<video src="../../assets/quick-start/dev.mp4" width="100%" height="auto" controls="controls"></video>
7171

7272
到此,上手完毕。
73+
74+
## 注意事项
75+
76+
1. 新增的页面需要重新 `npm run dev` 来进行编译

docs/qa.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<script crossorigin="anonymous" src="//www.dpfile.com/app/owl/static/owl_1.5.28.js"></script>
2+
<script>
3+
Owl.start({
4+
project: 'mpvue-doc',
5+
pageUrl: 'qa'
6+
})
7+
</script>
8+
9+
# 常见问题
10+
## vue-router 支持吗?
11+
12+
路由是不能支持的,因为小程序无法动态的插入和控制节点,几乎无法实现。而且小程序对页面的切换性能做了很多优化,页面切换体验也好了很多,所以使用 vue-router 也不那么必要
13+
14+
## 为什么我新增了页面,没有反应?
15+
16+
因为 webpack 编译的文件使用配置的 entry 决定的,新增的页面并没用添加进 entry,所以需要手动 `npm run dev` 一下,考虑不是高频操作,所以还可以忍受
17+
18+
## 能不能引用第三方的 UI 库?
19+
20+
原理上是可以的,但是要去掉 Dom 和 Bom 相关的 API 操作,还要去掉 mpvue 不支持的一些 vue 特性,小程序不支持的 css 选择器等,去掉这些就可以使用了,欢迎大家贡献 mpvue 的 UI 组件库。
21+
22+
## 能否使用 echarts 等小程序原生组件?
23+
24+
可以,可以看下[demo](https://github.com/mpvue/examples/tree/master/echarts)

fedocs/nav.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{% for nav_item in nav %}
1616
{% if nav_item.children %}
1717
<li class="nav-dropdown-container">
18-
<a class="nav-link">{{ nav_item.title }}</a><span class="arrow"></span>
18+
<a class="nav-link" href="{{nav_item.children[0].url}}">{{ nav_item.title }}</a><span class="arrow"></span>
1919
<ul class="nav-dropdown">
2020
{% for nav_item in nav_item.children %}
2121
{% include "nav-sub.html" %}

mkdocs.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,18 @@ site_url: http://mpvue.com/
33
site_description: 'mpvue-docs'
44
theme_dir: fedocs
55
site_favicon: 'assets/favicon.ico'
6+
pages:
7+
- [index.md, Home]
8+
- [mpvue/index.md, Mpvue]
9+
- [mpvue/mpvue-template-compiler.md, Mpvue]
10+
- [mpvue/quickstart.md, Mpvue ]
11+
- [mpvue/simple.md, Mpvue]
12+
- [build/index.md, Build]
13+
- [build/mpvue-loader.md, Build]
14+
- [build/mpvue-webpack-target.md, Build ]
15+
- [build/postcss-mpvue-wxss.md, Build]
16+
- [build/px2rpx-loader.md, Build]
17+
- [qa.md, Q&A]
18+
619
extra:
720
css: 'assets/style.css'

0 commit comments

Comments
 (0)