diff --git a/blog/README.md b/blog/README.md index 7c1d8c2..e220f6b 100644 --- a/blog/README.md +++ b/blog/README.md @@ -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 @@ -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). diff --git a/blog/components/snackbar.js b/blog/components/snackbar.js index ea7d416..948603d 100644 --- a/blog/components/snackbar.js +++ b/blog/components/snackbar.js @@ -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; @@ -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 () => {