New Blog = Vue2.0 && ES6 && 知乎专栏
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build
config
dist
src
static
.babelrc
.editorconfig
.gitignore
README.md
favicon.ico
index.html
package.json

README.md

blog

A Vue.js project

Build Setup

# install dependencies
npm install

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

# build for production with minification
npm run build

使用技术

  1. Vue2.0
  2. ES6

脚手架

vue-cli

UI

知乎专栏

依赖

  1. vue-router
  2. vuex
  3. vue-resource
  4. z-vue-components
  5. less
  6. less-loader
  7. markdown-it
  8. highlight.js

webpack配置

less-loader

{
  test: /\.less$/,
  loader: 'less'
}

该记住的点

  1. 网页被卷去的高: document.documentElement.scrollTop || document.body.scrollTop

  2. 使用LESS不能识别的属性:width: calc(100% - 56px);会变成width: calc(44%);应写成width: e("calc(100% - 56px)");

  var imgData = new FormData();
  var imgFile = document.getElementById('js-title-img-input').files[0]
  imgData.append('smfile', imgFile)

这样子直接console.log(imgData)拿到的东西似乎是没用的,imgData中的数据也不能通过imgData.smfile来获取,要使用imgData.get('smfile')

兼容性问题

手机浏览器@blur无效:写文章页面的请输入标题和请输入正文的提示文案不一定能正常显示(只影响了视觉效果,不影响功能,日后看情况解决)