瀏覽代碼

Force empty object in case of no parameter match

Shaun 2 年之前
父節點
當前提交
52971aac92
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      package.json
  2. 1 1
      src/index.js

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@shaun/alpinejs-router",
-  "version": "1.2.9",
+  "version": "1.2.10",
   "description": "Easy to use and flexible router for Alpine.js",
   "type": "module",
   "main": "dist/module.cjs.js",

+ 1 - 1
src/index.js

@@ -22,7 +22,7 @@ export default function (Alpine) {
       return state.query
     },
     get params () {
-      return state.params
+      return state.params || {}
     },
     get loading () {
       return state.loading