caring-route 0.0.1 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -0
- package/package.json +14 -56
- package/README.MD +0 -8
- package/index.html +0 -20
- package/pnpm-lock.yaml +0 -4466
- package/release.sh +0 -31
- package/src/App.vue +0 -25
- package/src/caring-route/helpers/util.js +0 -55
- package/src/caring-route/index.js +0 -171
- package/src/caring-route/package.json +0 -12
- package/src/main.js +0 -10
- package/src/manifest.json +0 -72
- package/src/pages/index/four.vue +0 -14
- package/src/pages/index/index.vue +0 -48
- package/src/pages/index/three.vue +0 -14
- package/src/pages/index/two.vue +0 -14
- package/src/pages.json +0 -34
- package/src/uni.scss +0 -76
- package/vite.config.js +0 -8
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t={},e=!0,r="brackets"){let a=e?"?":"",o=[];-1==["indices","brackets","repeat","comma"].indexOf(r)&&(r="brackets");for(let e in t){let a=t[e];if(!(["",void 0,null].indexOf(a)>=0))if(a.constructor===Array)switch(r){case"indices":for(let t=0;t<a.length;t++)o.push(e+"["+t+"]="+a[t]);break;case"brackets":default:a.forEach((t=>{o.push(e+"[]="+t)}));break;case"repeat":a.forEach((t=>{o.push(e+"="+t)}));break;case"comma":let t="";a.forEach((e=>{t+=(t?",":"")+e})),o.push(e+"="+t)}else o.push(e+"="+a)}return o.length?a+o.join("&"):""}const e=["navigateTo","redirectTo","reLaunch"],r=["navigateTo","redirectTo","reLaunch","navigateBack","switchTab"];function a(t){const{routeUrl:e,routeType:r="navigateTo",delta:a=1,events:o}=t;return new Promise(((t,n)=>{uni[r]({url:e,delta:a,events:o,success:e=>t(e),fail:t=>n(t)})}))}class o{handleParams(t={}){const e={};for(let r in t)"object"==typeof t[r]&&(e[r]=encodeURIComponent(JSON.stringify(t[r]))),"string"==typeof t[r]&&t[r].includes("http")&&(t[r]=encodeURIComponent(t[r]));return Object.assign(t,e)}query(t){const e={};for(const r in t)if("object"!=typeof t[r]){const a=decodeURIComponent(t[r]);(a.startsWith("{")||a.startsWith("["))&&"string"==typeof a&&(e[r]=JSON.parse(a))}return Object.assign(t,e)}navigate(t,e){return!!t&&("string"==typeof t?(e||(e={}),e.routeUrl=this.mixinParam(t,e),a(e)):(o=t,"[object Object]"===toString.call(o)?(e=t,r.includes(e.type)&&"string"==typeof e.url?(e.routeUrl=t.url,e.routeType=t.type,Reflect.deleteProperty(e,"url"),Reflect.deleteProperty(e,"type"),e.routeUrl=this.mixinParam(e.routeUrl,e.params),a(e)):this.query(e)):void 0));var o}mixinParam(e,r){e=e&&this.addRootPath(e);let a="";return/.*\/.*\?.*=.*/.test(e)?(a=t(this.handleParams(r),!1),e+"&"+a):(a=t(this.handleParams(r)),e+a)}to(t,e){const r={routeType:"navigateTo",routeUrl:t,params:e};this._navigateMethod(r)}back(t){const e={routeType:"navigateBack",delta:t};this._navigateMethod(e)}tab(t){const e={routeType:"switchTab",routeUrl:t};this._navigateMethod(e)}direct(t,e){const r={routeType:"redirectTo",routeUrl:t,params:e};this._navigateMethod(r)}launch(t,e){const r={routeType:"reLaunch",routeUrl:t,params:e};this._navigateMethod(r)}_navigateMethod(t){return e.includes(t.routeType)?t.routeUrl=this.mixinParam(t.routeUrl,t.params):t.routeUrl=t.routeUrl&&this.addRootPath(t.routeUrl),a(t)}addRootPath(t){return"/"===t[0]?t:`/${t}`}}var n=function(){const t=new o,e=o.prototype.navigate.bind(t);return Object.setPrototypeOf(e,t),e}();export{n as default};
|
package/package.json
CHANGED
|
@@ -1,63 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "caring-route",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
4
9
|
"scripts": {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"dev:app": "uni -p app",
|
|
8
|
-
"dev:custom": "uni -p",
|
|
9
|
-
"dev:h5": "uni",
|
|
10
|
-
"dev:h5:ssr": "uni --ssr",
|
|
11
|
-
"dev:mp-alipay": "uni -p mp-alipay",
|
|
12
|
-
"dev:mp-baidu": "uni -p mp-baidu",
|
|
13
|
-
"dev:mp-kuaishou": "uni -p mp-kuaishou",
|
|
14
|
-
"dev:mp-lark": "uni -p mp-lark",
|
|
15
|
-
"dev:mp-qq": "uni -p mp-qq",
|
|
16
|
-
"dev:mp-toutiao": "uni -p mp-toutiao",
|
|
17
|
-
"dev:mp-weixin": "uni -p mp-weixin",
|
|
18
|
-
"dev:quickapp-webview": "uni -p quickapp-webview",
|
|
19
|
-
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
|
|
20
|
-
"dev:quickapp-webview-union": "uni -p quickapp-webview-union",
|
|
21
|
-
"build:app": "uni build -p app",
|
|
22
|
-
"build:custom": "uni build -p",
|
|
23
|
-
"build:h5": "uni build",
|
|
24
|
-
"build:h5:ssr": "uni build --ssr",
|
|
25
|
-
"build:mp-alipay": "uni build -p mp-alipay",
|
|
26
|
-
"build:mp-baidu": "uni build -p mp-baidu",
|
|
27
|
-
"build:mp-kuaishou": "uni build -p mp-kuaishou",
|
|
28
|
-
"build:mp-lark": "uni build -p mp-lark",
|
|
29
|
-
"build:mp-qq": "uni build -p mp-qq",
|
|
30
|
-
"build:mp-toutiao": "uni build -p mp-toutiao",
|
|
31
|
-
"build:mp-weixin": "uni build -p mp-weixin",
|
|
32
|
-
"build:quickapp-webview": "uni build -p quickapp-webview",
|
|
33
|
-
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
|
34
|
-
"build:quickapp-webview-union": "uni build -p quickapp-webview-union"
|
|
35
|
-
},
|
|
36
|
-
"dependencies": {
|
|
37
|
-
"@dcloudio/uni-app": "3.0.0-alpha-3031320220314002",
|
|
38
|
-
"@dcloudio/uni-app-plus": "3.0.0-alpha-3031320220314002",
|
|
39
|
-
"@dcloudio/uni-components": "3.0.0-alpha-3031320220314002",
|
|
40
|
-
"@dcloudio/uni-h5": "3.0.0-alpha-3031320220314002",
|
|
41
|
-
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-3031320220314002",
|
|
42
|
-
"@dcloudio/uni-mp-baidu": "3.0.0-alpha-3031320220314002",
|
|
43
|
-
"@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3031320220314002",
|
|
44
|
-
"@dcloudio/uni-mp-lark": "3.0.0-alpha-3031320220314002",
|
|
45
|
-
"@dcloudio/uni-mp-qq": "3.0.0-alpha-3031320220314002",
|
|
46
|
-
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3031320220314002",
|
|
47
|
-
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3031320220314002",
|
|
48
|
-
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3031320220314002",
|
|
49
|
-
"caring-css": "^0.1.31",
|
|
50
|
-
"vue": "^3.2.31",
|
|
51
|
-
"vue-i18n": "^9.1.9",
|
|
52
|
-
"vuex": "^4.0.2"
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
|
+
"build": "rollup -c"
|
|
53
12
|
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": "风度万人迷",
|
|
16
|
+
"license": "ISC",
|
|
54
17
|
"devDependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"
|
|
57
|
-
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3031320220314002",
|
|
58
|
-
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3031320220314002",
|
|
59
|
-
"autoprefixer": "^10.4.2",
|
|
60
|
-
"sass": "^1.49.9",
|
|
61
|
-
"vite": "^2.8.6"
|
|
18
|
+
"@rollup/plugin-terser": "^0.4.1",
|
|
19
|
+
"rollup": "^3.21.5"
|
|
62
20
|
}
|
|
63
21
|
}
|
package/README.MD
DELETED
package/index.html
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<script>
|
|
6
|
-
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
|
7
|
-
CSS.supports('top: constant(a)'))
|
|
8
|
-
document.write(
|
|
9
|
-
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
|
10
|
-
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
|
11
|
-
</script>
|
|
12
|
-
<title></title>
|
|
13
|
-
<!--preload-links-->
|
|
14
|
-
<!--app-context-->
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
<div id="app"><!--app-html--></div>
|
|
18
|
-
<script type="module" src="/src/main.js"></script>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|