最近在学习Vue.js,因为实践是一种很好的学习方式,所以利用 Vue.js 和 CNodejs.org 提供的 API 搭建了一个Web APP。
访问地址:http://jchehe.github.io/mystatic/vue_cnode/ 源码地址:https://github.com/JChehe/vue_cnode PS: 你要★ Star ★我也不会拒绝哦^_^ 访问二维码:此处输入图片的描述
在此,也感谢 @shinygang 的 用Vue.js编写了cnodejs.org的h5客户端(webapp) 项目,我从中也学到了一些知识。
由于经验不足,若各位大大发现应用或代码哪里有可以改进或不完善的地方,欢迎大家在提 issue 或 pr,也可以评论。
本地部署
当然,你也可以在本地部署该项目。
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
截图
list
- 首页_列表页 -
sidebar
- 侧边栏 -
topic
- 帖子 -
newpost
- 新帖 -
perinfo
- 个人信息 -
不错不错,加油加油!<br/><br/><a class="form" href="https://github.com/shinygang/Vue-cnodejs">I‘m webapp-cnodejs-vue</a>
@JChehe 我这里也写了一个react版code,但是不晓得怎么像你那样放到线上访问:https://github.com/1340641314/react-cnode
@1340641314 我在Github page 搭建了静态博客https://pages.github.com/,而vue_cnode则放在source目录下,source目录下的文件会在发布到Github前进行"渲染"处理,但是我们配置文件_config.yml中设置了 skip_render: mystatic/**/*,即忽略mystatic文件下的文件,直接发布到github上。
2016年08月10日_151635.jpg
@yakczh react的生命周期,感觉要比vue的麻烦<br><br>来自疯狂的<a href="https://github.com/1340641314/react-cnode" target="_blank">react-cnode</a>
@Succy 目前的确是没有提供的,你可以想CNode 一样,用省略号。 极端点:可以https://cnodejs.org/api/v1/topics?limit=100000000000000000000
其中limit是无限大==!! 但这是不正常的做法
不错。。我也用vuejs + vue-cli + vue-router + vuex写过一个。 gayhub: https://github.com/beilunyang/cnodejs-vue demo: http://demo.bitibiti.com/cnodejs-vue/#!/
我参照你的方式配置路由一直不成功
import Vue from 'vue'
import App from './App'
import VueRouter from 'vue-router'
import routerMap from './router'
import VueResource from 'vue-resource'
Vue.use(VueResource)
Vue.use(VueRouter)
var router = new VueRouter()
routerMap(router)
Vue.use(router)
router.start(App, 'app')
报错信息如下 vue.common.js?e881:10008 Uncaught TypeError: plugin.apply is not a function Vue.use @ vue.common.js?e881:10008 (anonymous function) @ main.js?3479:13 (anonymous function) @ app.js:699 webpack_require @ app.js:583 fn @ app.js:107 (anonymous function) @ app.js:637 webpack_require @ app.js:583 (anonymous function) @ app.js:629 (anonymous function) @ app.js:632 可以帮忙看下吗
@Succy 试了不行 是Vue.use(router)这报错了
Vue.use = function (plugin) {
/* istanbul ignore if */
if (plugin.installed) {
return;
}
// additional parameters
var args = toArray(arguments, 1);
args.unshift(this);
if (typeof plugin.install === 'function') {
plugin.install.apply(plugin, args);
} else {
plugin.apply(null, args);
}
plugin.installed = true;
return this;
};
plugin.apply(null, args); 这个地方报错的