Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
blesstosam committed Feb 6, 2020
1 parent 300fa54 commit 86f60df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
12 changes: 10 additions & 2 deletions blog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

> A simple blog - Blog and Admin.

## Include

- [x] User (register/login)
- [x] Content (crud)
- [x] Category (crud)
- [ ] Tags (crud)
- [ ] Comments (crud)
- [ ] ViewsCount (include view user)

## Build Setup

``` bash
Expand All @@ -18,5 +28,3 @@ $ npm run start
# generate static project
$ npm run generate
```

For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org).
15 changes: 7 additions & 8 deletions blog/components/snackbar.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Vue from 'vue';
import toastComponent from './Snackbar.vue';
const ToastConstructor = Vue.extend(toastComponent);
import Snackbar from './Snackbar.vue';
const SnackbarConstructor = Vue.extend(Snackbar);

function showToast(snackbarText) {
const toastDom = new ToastConstructor({
function init(snackbarText) {
const _dom = new SnackbarConstructor({
el: document.createElement('div'),
created() {
this.snackbarText = snackbarText;
Expand All @@ -16,14 +16,13 @@ function showToast(snackbarText) {
}
});

// 把实例化的toast.vue 添加到body中
document.body.appendChild(toastDom.$el);
return toastDom;
document.body.appendChild(_dom.$el);
return _dom;
}

// 注册为全局组件的函数
function registerSnackbar() {
Vue.prototype.$snackbar = showToast;
Vue.prototype.$snackbar = init;
}

export default () => {
Expand Down

0 comments on commit 86f60df

Please sign in to comment.