GithubHelp home page GithubHelp logo

microzz / vue-cnode Goto Github PK

View Code? Open in Web Editor NEW
253.0 11.0 64.0 242 KB

🔥Vue.js打造一个开源的CNode社区。CNode by Vue.js

Home Page: https://microzz.com/vue-cnode/

JavaScript 21.68% HTML 0.64% Vue 74.57% CSS 3.11%
vue vuejs vuejs2 vue2 vuex vue-router webpack axios sass scss

vue-cnode's Introduction

Vue.js打造一个开源的CNode社区

Vue.js打造一个开源的CNode社区,实现了浏览、发帖、收藏、回复、点赞、个人中心等等功能。

源代码

源代码地址:👉 https://github.com/microzz/vue-cnode

欢迎大家star和fork😄

预览

在线预览地址:👉 https://microzz.com/vue-cnode/

技术栈

  • Vue2.0:前端页面展示。
  • Vuex:Vuex,实现不同组件间的状态共享
  • vue-router:页面路由切换
  • axios:一个基于 Promise 的 HTTP 库,向后端发起请求。
  • ExpressKoa2:因为vue-cli生成的项目是基于express的,所以在开发阶段我使用的是它,但是真正上线生产环境我换成了Koa2
  • Moment.js:一个时间处理的库,方便对时间进行格式化成需要的格式,如主题、回复时间显示"* 分钟前、* 小时前、*天前"等等。
  • ES6ES7:采用ES6语法,这是以后的趋势。箭头函数、Promise等等语法很好用。
  • localStorage:保存用户信息。
  • Canvas:页面顶部小雪花效果。
  • Webpack:vue-cli自带Webpack,但是需要自己改造一下,比如要对需要安装sass相关loader,vue-cli已经配置好了webpack,你只需要安装依赖就可以,使用的时候只需要<style lang="scss"></style>
  • SASS(SCSS):用SCSS做CSS预处理语言,有些地方很方便,个人很喜欢用。(详看👉SASS用法指南)
  • flex:flex弹性布局,简单适配手机、PC端。
  • CSS3:CSS3过渡动画及样式。

总结

  1. 组件状态多了用Vuex管理很方便,引用 Redux 的作者 Dan Abramov 的话说就是:

Flux 架构就像眼镜:您自会知道什么时候需要它。

  1. 事先一定要先想好整个页面组成,怎样去分组件开发,这样在开发阶段会事半功倍。
  2. Moment.js在Vue中用ES6的方式引入会有问题,可以尝试在main.js尝试这样import moment from 'moment' Vue.prototype.moment = moment;给Vue的原型上添加moment,这样就可以在Vue的实例中随意使用它了。
  3. 项目结构如下图

Vue-CNode by microzz.com

时间轨迹

  • 4.13:基本功能完成,后续完成登录后的操作。

  • 4.14:完成登录以及侧边栏。

  • 4.15:增加收藏

  • 4.16:加入回复、单条回复、点赞。项目完成。

About

源代码地址:👉 GitHub

个人网站:👉 microzz.com

GitHub:👉 microzz

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

vue-cnode's People

Contributors

microzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-cnode's Issues

scroll加载更多的bug

content.vue 里面滚动到底部的判断 不会完全相等 改为
let flag = Math.floor(event.target.clientHeight + event.target.scrollTop) === Math.floor(event.target.scrollHeight);
才可以。
另外,希望博主出一些ssr的文章和实例作品哦~

md

div class=“md” 这块的css 是自己写的么?

切换加载问题

tabs切换加载数据的时候已经加载过的,是不是就不用加载了。比如按首页时候已经加载一次数据,点其他tabs以后,在点回首页的时候就不用加载数据了吧。这样好像更好点。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.