Coder Social home page Coder Social logo

daily-zhihu's Introduction

知乎日报

声明

api来自知乎( 知乎Zhihu ), 项目中所有内容的一切权利属于知乎, 本项目所有内容及代码仅供私下学习参考, 不得作为其他用途

简介

  • 学习Vue.js蛮久的了, 也看了不少别人写的知乎日报, 干脆自己也拿日报练练手, 该项目使用vue-cli构建、打包, 配合vue全家桶(vue、vuex、vue-router)进行编码、使用axios进行资源请求

  • api使用node.js进行二次封装解决跨域问题, node使用Heroku进行部署

  • 使用sketch设计页面, 向着简约的方向做了一版

  • 图片防盗链问题使用以下meta标签解决。http协议中如果从一个网页跳到另一个网页,http头字段里面会带个referer,图片服务器通过检测referer是否来自规定域名,来进行防盗链。如果没有referer,服务器会认为是浏览器直接打开了文件,所以可以正常显示。

    <meta name="referrer" content="never">
  • 欢迎issue、fork、star😁

预览

预览

建议在手机或F12手机模式下浏览

运行方法

npm install
npm run dev

Tip

This relative module was not found:
./views/con in ./src/router.js

好多同学运行项目报如上错误,应该是 windows 系统不允许创建名称为 con 的文件解压错误所致,现在 con 文件已经修改为 article ,windows下解压运行不会再报错了😎

License

MIT

daily-zhihu's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

daily-zhihu's Issues

项目上线后api如何调用

开发过程中应该是在webpack.dev.conf.js文件中进行配置从而实现axios代理,那上线之后api是如何调用的呢?

字体图标显示不出来

我引入了字体图标文件,为什么使用<i class="iconfont icon-ic_menu" @click="toggle(true)">时候会不显示呢,是做了什么限制么

图片403禁止访问

参考着写的,文字可以显示,但是图片显示403禁止访问是因为什么啊

还是一样 npm run dev运行不了

$ npm run dev

[email protected] dev D:\Zhihu_vue\daily-zhihu
node build/dev-server.js

module.js:471
throw err;
^

Error: Cannot find module 'lodash/unionWith'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (D:\Zhihu_vue\daily-zhihu\node_modules\webpack-merge\l ib\index.js:3:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\ node_modules\npm\bin\npm-cli.js" "run" "dev"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dev: node build/dev-server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script 'node build/dev-server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the zhihu package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs zhihu
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls zhihu
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! D:\Zhihu_vue\daily-zhihu\npm-debug.log

icon ui库

<i class="iconfont" :class="{'iconcolor icon-ic_star_black':num == 1,'icon-ic_star':num != 1}" />

请问这个icon使用什么 UI库实现的?

跨域问题没结局啊

XMLHttpRequest cannot load https://news-at.zhihu.com/api/4/themes. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8088' is therefore not allowed access.

clone下载后,npm install后,本地运行没有错误,部署到服务器错误

本地运行http://localhost:8083可以运行正常,
但是部署到服务器时错误,
Failed to load resource: the server responded with a status of 404 ()
manifest.7477741344c67108b5d7.js:1 Failed to load resource: the server responded with a status of 404 ()
app.3f2dd1a7626b7193436e.js:1 Failed to load resource: the server responded with a status of 404 ()
vendor.ad15357dfbe42f9bd476.js:1 Failed to load resource: the server responded with a status of 404 ()
app.3f2dd1a7626b7193436e.js:1 Failed to load resource: the server responded with a status of 404 ()
app.0e31f34990a44256161c14ab2dc5aa86.css:1 Failed to load resource: the server responded with a status of 404 ()
我的首页路径是诸如:http://www.aaa.com/zhihu
是因为路径问题么?

问一些问题

在scroll.js中
watch: {
scroller( scroller, oldScroller ) {
if ( scroller === oldScroller ) return
this.$unbindScroll( oldScroller )
this.$bindScroll( scroller )
}
}
中的oldScroller从哪里来?

使用 keep-alive 关于滚动位置的问题

有一点没搞懂如何在返回上一个router的时候保存list滚动的位置
我自己照着你的写,back 后会默认定位到list初始位置
使用了 scrollBehavior 还是没有效果
感谢!希望可以帮助下我 😄

向你学习

照着你写的demo写,发现好多地方都看不懂,可以加个微信啵~

样式差距好大啊

仿照你的写到。内容详情页(con)样式差距好大啊。我的好像就没做适配一样。

bug反馈下

image
菜单的active样式在按返回按钮的时候是不会变动的。比如说,按了设计日报,那一栏变黄了。当返回上一页时,比如说返回到首页了,变黄的那一栏任然是设计日报,并不会变成首页

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.