Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/koakumaping/ct-hodor

ct-hodor
https://github.com/koakumaping/ct-hodor

ct-hodor vue-components vue2

Last synced: 3 months ago
JSON representation

ct-hodor

Awesome Lists containing this project

README

        

# ct-hodor
已离职 停止更新
三年不断更新迭代的成果,继续努力吧。
## install
```bash
npm install ct-hodor
```
## usage
```javascript
import ctHodor from 'ct-hodor'
import 'ct-hodor/dist/ctHodor.css'
Vue.use(ctHodor)

// 配置notice组件
const notice = new Vue.prototype.$notices(store)
window.notice = notice
```

## config vue template
```html




```

## notice usage
### vuex
```javascript
const notice = {
state: {
list: [],
timer: '',
},
mutations: {
ADD_NOTICE: (state, payload) => {
state.list.push(payload)
},
DEL_NOTICE: (state, key) => {
const notices = state.list
const l = notices.length
for (let i = 0; i < l; ++i) {
if (notices[i].key === key) {
notices.splice(i, 1)
break
}
}
},
},
}

export default notice
```

### usage
```javascript
window.notice.info({
title: '提示信息',
content: '内容',
})

window.notice.warn({
title: '提示信息',
content: '内容',
})

window.notice.success({
title: '提示信息',
content: '内容',
})

window.notice.error({
title: '提示信息',
content: '内容',
})
```