0.0.12 • Published 5 years ago

base-plugins-js v0.0.12

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

table-scroll

用于table表格滚动的插件;

使用:

import TableScroll 'base-plugin-js/table-scroll'
const tableScroll = new TableScroll(document.querySelector('#table'))
tableScroll.run()
tableScroll.destroy()

其中有针对elementui的方法elTableScroll,需要传入vue模板的ref;

import {elTableScroll} 'base-plugin-js/table-scroll'
// 在获取到数据后使用
this.tableScroll = elTableScroll(this.$refs.table)

// 销毁
destroyed() {
  this.tableScroll.destroy()
},

storage

默认使用

// 默认输出为storage(sessionStorage)
import storage, {localStorage} from 'base-plugin-js/storage'

storage.set('key', 'value')

storage.get('key')

// 获取到之后回调
storage.get('key', value => {
  console.log(value)
})

// 清空
storage.clear()

// 删除
storage.remove('key')

// 监听storage的设置事件
window.addEventListener('setItemEvent', evt => {
  console.log(evt.oldValue)
  console.log(evt.value)
  console.log(evt.key)
})

// localStorage 与storage方法相同
0.0.12

5 years ago

0.0.11

5 years ago

0.0.1

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago