Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/koakumaping/ct-hodor
- Owner: koakumaping
- License: mit
- Created: 2017-08-31T01:37:53.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-09T03:23:29.000Z (over 4 years ago)
- Last Synced: 2024-07-11T05:34:11.528Z (4 months ago)
- Topics: ct-hodor, vue-components, vue2
- Language: Vue
- Size: 7.67 MB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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: '内容',
})
```