Skip to content

Commit

Permalink
Merge branch 'yiruiwen'
Browse files Browse the repository at this point in the history
  • Loading branch information
wlxuqu committed Nov 18, 2020
2 parents 427ef7f + 60cabe4 commit 56b4bd8
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Vue.use(uView);
```css
/* App.vue */
<style lang="scss">
/* 注意声明lang="scss"! */
@import "uview-ui/index.scss";
</style>
```
Expand Down
Binary file removed i18n.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name" : "uView",
"appid" : "__UNI__60F4B81",
"description" : "多平台快速开发的UI框架",
"versionName" : "1.7.9",
"versionName" : "1.8.2",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
Expand Down
4 changes: 2 additions & 2 deletions uview-ui/libs/config/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 此版本发布于2020-11-10
let version = '1.7.9';
// 此版本发布于2020-11-19
let version = '1.8.2';

export default {
v: version,
Expand Down
26 changes: 13 additions & 13 deletions uview-ui/libs/function/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@
*/

class Router {
// 原始属性定义
config = {
type: 'navigateTo',
url: '',
delta: 1, // navigateBack页面后退时,回退的层数
params: {}, // 传递的参数
animationType: 'pop-in', // 窗口动画,只在APP有效
animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
intercept: false, // 是否需要拦截
}

constructor() {
// 原始属性定义
this.config = {
type: 'navigateTo',
url: '',
delta: 1, // navigateBack页面后退时,回退的层数
params: {}, // 传递的参数
animationType: 'pop-in', // 窗口动画,只在APP有效
animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
intercept: false, // 是否需要拦截
}
// 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
// 这里在构造函数中进行this绑定
this.route = this.route.bind(this)
}

// 判断url前面是否有"/",如果没有则加上,否则无法跳转
addRootPath(url) {
return String(url).indexOf('/') >= 0 ? url : `/${url}`
return url[0] === '/' ? url : `/${url}`
}

// 整合路由参数
mixinParam(url, params) {
url = url && this.addRootPath(url)

// 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
// 如果有url中有get参数,转换后无需带上"?"
let query = ''
Expand Down Expand Up @@ -65,7 +66,6 @@ class Router {
mergeConfig.params = params
// 合并内外部参数
mergeConfig = uni.$u.deepMerge(this.config, mergeConfig)

// 判断用户是否定义了拦截器
if (typeof uni.$u.routeIntercept === 'function') {
// 定一个promise,根据用户执行resolve(true)或者resolve(false)来决定是否进行路由跳转
Expand Down
2 changes: 1 addition & 1 deletion uview-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uview-ui",
"version": "1.7.9",
"version": "1.8.2",
"description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
"main": "index.js",
"keywords": [
Expand Down
Binary file removed 空白项目.zip
Binary file not shown.

0 comments on commit 56b4bd8

Please sign in to comment.