solid-alive 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/readme.md +9 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-alive",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "solid-alive",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "repository": {
29
29
  "type": "git",
30
- "url": "https://gitee.com/iuxs/solid-alive"
30
+ "url": "https://github.com/iuxs/solid-alive"
31
31
  },
32
32
  "author": "iuxs",
33
33
  "license": "ISC",
package/readme.md CHANGED
@@ -4,13 +4,18 @@
4
4
  - pnpm add solid-alive / npm i solid-alive / yarn add solid-alive
5
5
  ### 描述(describe)
6
6
  - 用于 solid 组件缓存,只测试过2级路由缓存
7
- - useAlive 中有 onActivated, onDeactivated,removeAliveElement 三个函数使用
7
+ - AliveProvider
8
+ - scrollId : 想滚动的元素id, 我用的getElementById
9
+ - behavior : 想 scrollId 的滚动条是 alwaysTop / savaScroll
10
+ - transitionEnterName : 'appear'/ 'toLeft'/...., Customizable 路由切换 的过渡动画, 但要在 App中引入 样式, import 'solid-alive/dist/styles/style.css', 自定义的css要用 @keyframes 来定义动画
11
+ - 在 useAlive
8
12
  - removeAliveElement: 函数, 可传一个参数, 不传就删除所有缓存 :
9
13
  removeAliveElement('/home')
10
14
  - onActivated / onDeactivated: 函数,只能传一个函数,多次调用只有最一个会调用.
11
15
  onActivated(()=> console.log('actived'))
12
- - directiveSaveScroll 保存滚动条指令, 不过能不用就不用, 但组件不能使用,只能标签
13
- - 可记住指定元素, 但要在 AliveProvider 中加 saveScrollElement 参数, 最好唯一. 但组件内部的滚动条问题 有个指令函数,
16
+ - directiveSaveScroll: 保存滚动条指令, 不过能不用就不用, 但组件不能使用,只能标签!!!ref会拿不到dom
17
+ - resetElScroll : 重置元素的滚动条
18
+ - removeScrollEl : 删除元素在alive中保存的dom
14
19
  - 子父 缓存/删除 问题
15
20
  - 如果某组件下有子组件,在父的 AliveTransfer中,
16
21
  第三个参数,为对象 写上子组件的唯一id: {children:['/childrenId','asf',...]}
@@ -25,6 +30,7 @@ import { render } from 'solid-js/web'
25
30
  import App from './App'
26
31
  import { AliveProvider } from 'solid-alive'
27
32
  const root = document.getElementById('root')
33
+ import 'solid-alive/dist/styles/style.css' // transition css,
28
34
 
29
35
  render(() =>
30
36
  {/* save id is client scroll, */}